Class: Config

Config()

Classes

Config

Methods

_removeDefaults(configObj, defaultConfig)

Strips a config object of all values that are the same as in the default config

Parameters:
Name Type Description
configObj Object

the config object we want to remove default values from

defaultConfig Object

the default config we are comparing against

Source:

_writeConfigValue(configObj, config)

For every config key in 'configObj', it overrides the same key in 'config'. Only works with always nested values (no string|object)

Parameters:
Name Type Description
configObj object
config object
Source:

fixType(stringValue, The)

Converts integers to strings if necessary

Parameters:
Name Type Description
stringValue string

A string that may be converted

The string | number

fixed value

Source:

getCliObject() → {object}

Interprets CLI arguments as key value pairs for the configuration e.g. yarn dev logLevel info

Source:
Returns:

An object containing all configuration values specified through the CLI

Type
object

loadConfigIfExists()

Reads the config.json if it exists

Source:

loadConfigIfExists()

Reads the config.json if it exists

Source:

(async) writeConfig(args)

Changes a key of the configuration

Parameters:
Name Type Description
args

A list containing [key, value]. Key being the key that is to be read. Value the new value for that key

Source:

(async) writeConfig(args)

Changes a key of the configuration

Parameters:
Name Type Description
args

A list containing [key, value]. Key being the key that is to be read. Value the new value for that key

Source:

ConfigConfig()

Classes

Config

Methods

_removeDefaults(configObj, defaultConfig)

Strips a config object of all values that are the same as in the default config

Parameters:
Name Type Description
configObj Object

the config object we want to remove default values from

defaultConfig Object

the default config we are comparing against

Source:

_writeConfigValue(configObj, config)

For every config key in 'configObj', it overrides the same key in 'config'. Only works with always nested values (no string|object)

Parameters:
Name Type Description
configObj object
config object
Source:

fixType(stringValue, The)

Converts integers to strings if necessary

Parameters:
Name Type Description
stringValue string

A string that may be converted

The string | number

fixed value

Source:

getCliObject() → {object}

Interprets CLI arguments as key value pairs for the configuration e.g. yarn dev logLevel info

Source:
Returns:

An object containing all configuration values specified through the CLI

Type
object

loadConfigIfExists()

Reads the config.json if it exists

Source:

loadConfigIfExists()

Reads the config.json if it exists

Source:

(async) writeConfig(args)

Changes a key of the configuration

Parameters:
Name Type Description
args

A list containing [key, value]. Key being the key that is to be read. Value the new value for that key

Source:

(async) writeConfig(args)

Changes a key of the configuration

Parameters:
Name Type Description
args

A list containing [key, value]. Key being the key that is to be read. Value the new value for that key

Source: