new Config()
Classes
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 |
_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 |
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 |
getCliObject() → {object}
Interprets CLI arguments as key value pairs for the configuration e.g. yarn dev logLevel info
Returns:
An object containing all configuration values specified through the CLI
- Type
- object
loadConfigIfExists()
Reads the config.json if it exists
loadConfigIfExists()
Reads the config.json if it exists
(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 |
(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 |