setConfigValue
setConfigValue<
T>(config,key,value):T
Set a dotted path, returning a new document. Non-mutating and creating any
intermediate objects, so set works on an empty file.
The key must be a known setting and the value must match its type; both throw ConfigError rather than writing something that will fail to load next time, as does an existing intermediate value that is not an object. The generic return means a raw record edits to a raw record with its unknown keys untouched.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
T extends object |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
config | T |
key | string |
value | unknown |
Returns
Section titled “Returns”T