Skip to main content

@versionzero/configurator / configuration-sources / ObjectSource

Class: ObjectSource

Defined in: configuration-sources/object-source.js:18

ObjectSource - load configuration assignments from an object

The object passed in the context is checked against the configuration schema. If the schema defines child properties, then the object's children are recursively checked in the same manner.

When this process hits a schema that does not define children, an assignment is generated with the current value.

In other words, a given object may be broken out into a collection of individual property assignments, or it could result in a single assignment; it depends on how deeply nested the schemas are defined.

Extends

Extended by

Methods

load()

load(schema, context, options?): Promise<Map<string, any>>

Defined in: configuration-sources/object-source.js:32

Parse configuration from this source

Parameters

ParameterTypeDescription
schemaCompiledSchema-
contextanycollection of source-specific fields (argv, env, etc.)
options?anyload options

Returns

Promise<Map<string, any>>

Parsed configuration object

Overrides

ConfigurationSource.load