Releases: litert/config-loader.js
v1.2.0
CHANGES
-
fix(loader): correctly use
parentparameter when loading files -
feat(loader): added
loadFromObjectandloadFromObjectSyncmethodsNew methods
loadFromObjectandloadFromObjectSynchave been added to
theConfigLoaderclass to allow loading configuration data directly
from in-memory objects. These methods accept an object containing the
configuration data and an optional file path for context. This feature is
useful for scenarios where configuration data is generated or modified at
runtime, eliminating the need to read from external files.
Full Changelog: v1.1.1...v1.2.0
v1.1.1
CHANGES
-
feat(loader): added
skipUnknownOperatorsoptionA new loader option
skipUnknownOperatorshas been added to allow users
to skip unknown operators during the loading process. When this option is
set totrue, any operator that is not recognized will be ignored, and
its original value will be retained in the output. This is useful in
scenarios where the configuration may contain custom or unsupported
operators that should not cause loading failures.
Full Changelog: v1.1.0...v1.1.1
v1.1.0
CHANGES
-
feat(loader): added operation options supports
A new operator options syntax has been introduced to allow users to
provide custom options to operators in the configuration file. The syntax
is as follows:inlineMode: abc-$[[op1: operand; a; b = value2; c=; ...]]-def blockMode: $[[op1: operand; a; b = value2; c=; ...]] $[[op3: operand; a; b = value2; c=; ...]]: "containerModeValue"
For example, to provide options to the
EnvironmentVariableoperator:database: host: $[[env:DB_HOSTNAME; default=localhost]]
Click to read more about Operation Options.
-
feat(operator): [EnvironmentVariable] added readEnv option
A new optional parameter
readEnvis added to theEnvironmentVariable
operator options, which allows users to provide a custom function to read
environment variables. This is useful in scenarios where environment
variables are read from an alternative source other than the default
process.env. -
feat(operator): [EnvironmentVariable] added multiple variable names chaining support
The
EnvironmentVariableoperator now supports specifying multiple
environment variable names separated by commas. The operator will check
each variable in order and use the value of the first one that is defined.
For example:database: host: "$[[env:DB_HOSTNAME,DB_HOST]]"
-
feat(operator): [EnvironmentVariable] space character are now allowed between variable names
The
EnvironmentVariableoperator now allows space characters between
variable names when specifying multiple environment variables. This
improves readability without affecting functionality.database: host: "$[[env: DB_HOSTNAME , DB_HOST ]]"
-
feat(operator): [EnvironmentVariable] added explicit default value support
The
EnvironmentVariableoperator now allows users to specify an explicit
default value using the syntax"$[[env:<variable-names>:<default-value>]]"
in the config. If none of the specified environment variables are found,
the explicitly provided default value will be used.database: host: "$[[env: DB_HOSTNAME , DB_HOST ; default = localhost]]"
Full Changelog: v1.0.1...v1.1.0
v1.0.1
CHANGES
-
fix(loader): should not overwrite object by object in context output.
When loading a property in an object, if the property is an object, and
it's already existing in the context output, the existing object should be
used as the object container, and the there should be a merge instead of
overwriting. -
fix(data-reader): the file reader should not throw error with unknown files
If the extension of the loading file is unrecognizable, it should just
simply return an empty encoding, instead of throwing exceptions, which
would cause failure when reading non-configuration files.
Full Changelog: v1.0.0...v1.0.1