Constructor
new Config(defaultConfig, desiredConfig)
- Source:
Constructor.
Parameters:
| Name | Type | Description |
|---|---|---|
defaultConfig |
Object | Default configurations for the object. |
desiredConfig |
Object | Desired configuration. |
Methods
getConfig(opts) → {Object}
- Source:
Get stored configuration/
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
opts |
Object | Options for returned configuration. Properties
|
Returns:
Set configuration.
- Type
- Object
getConfigByKey(key) → {Any}
- Source:
Get a configuration property by key.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Name of property. |
Returns:
Property value.
- Type
- Any
getDefaultConfig() → {Object}
- Source:
This function returns a deep clone of the default configuration. Therefore, modify return object would not affect the default configuration.
Returns:
Default configuration.
- Type
- Object
setConfigByKey(key, value)
- Source:
Set property value to configuration by key. If key is not in defaultConfiguration, do nothing.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Name of property. |
value |
Any | Property value. |
toParams(opts) → {Array.<string>}
- Source:
Export configuration as python argument strings.
Parameters:
| Name | Type | Description | ||||||
|---|---|---|---|---|---|---|---|---|
opts |
Object | Options. Properties
|
Returns:
Python argument string as array.
- Type
- Array.<string>