Opposite of get, dynamically set a nested value into an object
using a key path. Does not modify the given initial object.
Primitive intermediates are replaced with objects or arrays when
a property needs to change.
Opposite of get, dynamically set a nested value into an object
using a key path. Does not modify the given initial object.
Primitive intermediates are replaced with objects or arrays when
a property needs to change.
When a path needs to write through an existing primitive value, that value is
replaced with a plain object, or an array when the next path key is an integer.
The original input is preserved.
import*as
import _
_from'radashi'
import _
_.
functionset<{
a:number;
}, number>(initial: {
a:number;
}, path:string, value:number): {
a:number;
}
Opposite of get, dynamically set a nested value into an object
using a key path. Does not modify the given initial object.
Primitive intermediates are replaced with objects or arrays when
a property needs to change.
Opposite of get, dynamically set a nested value into an object
using a key path. Does not modify the given initial object.
Primitive intermediates are replaced with objects or arrays when
a property needs to change.
An existing primitive can remain unchanged when the requested value already
matches. For example, setting a.length to 3 on { a: 'str' } returns the
original object.