Skip to content

Releases: litert/config-loader.js

v1.2.0

13 Nov 14:32
v1.2.0
b828baa

Choose a tag to compare

CHANGES

  • fix(loader): correctly use parent parameter when loading files

  • feat(loader): added loadFromObject and loadFromObjectSync methods

    New methods loadFromObject and loadFromObjectSync have been added to
    the ConfigLoader class 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

12 Nov 16:00
v1.1.1
c24b97e

Choose a tag to compare

CHANGES

  • feat(loader): added skipUnknownOperators option

    A new loader option skipUnknownOperators has been added to allow users
    to skip unknown operators during the loading process. When this option is
    set to true, 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

09 Nov 07:47
v1.1.0
86e731f

Choose a tag to compare

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 EnvironmentVariable operator:

    database:
      host: $[[env:DB_HOSTNAME; default=localhost]]

    Click to read more about Operation Options.

  • feat(operator): [EnvironmentVariable] added readEnv option

    A new optional parameter readEnv is added to the EnvironmentVariable
    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 EnvironmentVariable operator 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 EnvironmentVariable operator 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 EnvironmentVariable operator 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

18 Aug 03:23
v1.0.1
4eeb4e0

Choose a tag to compare

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

v1.0.0

07 Jun 06:47
v1.0.0
df1de0c

Choose a tag to compare

The first release