Skip to content

loadLayeredFromContent

loadLayeredFromContent<T>(options): Promise<LayeredResult<T> | null>

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

loadLayered for config files that live somewhere other than the local disk (a GitHub API, a git blob): the dedicated <name>.config.* layered over the [fallback.key] of <fallback.file>.config.*, each probed through options.fetch and executed in options.dir, then merged with mergeLayers (the dedicated file wins). Returns null when neither layer resolves; filepath and sources are the paths as fetch was asked for them (astromech.config.ts), lowest priority first.

A source that is found but cannot be executed throws a ConfigFileError whose filepath is that path, so a caller can say which file failed. Whatever fetch throws (a network failure, a permission error) propagates as it is.

T

LoadLayeredFromContentOptions<T>

Promise<LayeredResult<T> | null>