Constructor
new Configuration(initialMap)
Constructor.
For any properties passed on initialMap
, module:util~Configuration#value will be called so those properties are defined on this instance.
Name | Type | Description |
---|---|---|
initialMap | object | the optional initial properties to store |
- Source
Methods
enabled(key) → {boolean}
Test if a key is truthy.
Name | Type | Description |
---|---|---|
key | string | the key to test |
- Source
true
if the key is enabled
- Type:
- boolean
toggle(key, enabled) → {module:util~Configuration}
Set or toggle the enabled status of a given key.
If the `enabled` parameter is not passed, then the enabled status will be toggled to its opposite value.
Name | Type | Description |
---|---|---|
key | string | they key to set |
enabled | boolean | the optional enabled value to set |
- Source
this object to allow method chaining
value(key, newValueopt) → {object}
Get or set a configuration value.
Name | Type | Attributes | Description |
---|---|---|---|
key | string | The key to get or set the value for | |
newValue | object | <optional> | If defined, the new value to set for the given |
- Source
If called as a getter, the associated value for the given key
, otherwise this object.
- Type:
- object
values(newMapopt) → {object}
Get or set multiple properties.
Name | Type | Attributes | Description |
---|---|---|---|
newMap | object | <optional> | a map of values to set |
- Source
if called as a getter, all properties of this object copied into a simple object; otherwise this object
- Type:
- object