@absolunet/ioc2.1.0

View on GitHub

ConfigGrammar

Class that handle configuration specific grammar. It formats configuration entry by replacing specific tokens and patterns. It also uses the evaluator to return evaluated value in addition to the token parsing.

Members

(static) dependencies :Array.<string>

Source:
Class dependencies: ['app', 'env', 'evaluator'].

pipeline :Array.<string>

Source:
Replacement pipeline.

replacements :object.<string, Array.<{search: RegExp, replace: string}>>

Source:
Replacements list accessor.

Methods

format(value)

Source:
Format given configuration value.
Parameters:
Name Type Description
value * The value to format.
Returns:
The formatted value.
Type
*

formatEnvironment(value)

Source:
Parse environment variable in configuration value.
Parameters:
Name Type Description
value string The value to format.
Returns:
The formatted value.
Type
string

formatPath(value)

Source:
Format given path to absolute path.
Parameters:
Name Type Description
value string The value to format.
Returns:
The formatted value.
Type
string

replaceValue(value, type)

Source:
Replace value by the given replacement type configured patterns.
Parameters:
Name Type Description
value string The value to format.
type string The type of replacement to operate. The type should be an existing key of the replacements property.
Returns:
The formatted value.
Type
boolean | null | number | string