Skip to content

LoadLayeredFromContentOptions

Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:5

Options for loadLayeredFromContent: loadLayered for config files read through a fetch callback.

T = unknown

optional coerce?: (raw) => T | undefined

Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:31

Turns each layer’s raw value into the shape being merged, before the merge; return undefined to treat the layer as absent. Same as LoadLayeredOptions.coerce.

unknown

T | undefined


dir: string

Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:11

Directory the fetched files are written into before they are executed (see loadConfigFromContent): it has to sit under a tree where the packages a config imports resolve, which is what withConfigSandbox prepares. The caller creates and removes it.


optional extensions?: readonly string[]

Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:22

Override the extension probe order.

ReadConfigSourceOptions.extensions


optional fallback?: object

Defined in: cli/datapad/src/load-layered-from-content/load-layered-from-content.type.ts:16

Read <file>.config.* and take its [key] as the lower layer; the dedicated file (name), if any, is merged on top. Either layer may be absent.

optional file?: string

Base name of the fallback file, fetched as <file>.config.*. Not needed with preloaded.

key: string

The key in the fallback file whose value is taken.

optional preloaded?: Loaded<object> | null

The fallback file as the caller already loaded it (null: it was looked for and isn’t there), used as is instead of fetching it again. Its filepath is reported in sources.


fetch: (path) => Promise<string | undefined>

Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:20

Fetches one file by relative path (holocron.config.ts): its content, or undefined when it doesn’t exist. Throw for anything else (a network failure, a permission error) — that propagates rather than reading as “absent”.

string

Promise<string | undefined>

ReadConfigSourceOptions.fetch


name: string

Defined in: cli/datapad/src/read-config-source/read-config-source.type.ts:14

Base name — "holocron" probes holocron.config.{ts,js,mjs,cjs,json}.

ReadConfigSourceOptions.name