assoc-path
v0.9.6arrow_drop_downv0.9.6
STATUS
Passing
DOWNLOADS
3
VISIBILITY
Public
PUBLISHED
5 years ago
SIZE
N/A
Makes a shallow clone of an object, setting or overriding the nodes required
1 contributor
Like
Install assoc-path as a package?
Copied
npm i @bit/justin-capalbo.ramda.assoc-path
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.cloud
Component Example modifieddraft
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
and packages in Bit or NPM to the example. any of the 1 million componentstoggle layout
No preview available
chevron_left
chevron_right
assocPath (
path:
Array
,val:
*
,obj:
) : Object
Object
Makes a shallow clone of an object, setting or overriding the nodes required to create the given path, and placing the specific value at the tail end of that path. Note that this copies and flattens prototype properties onto the new object as well. All non-primitive properties are copied by reference.
Example
Arguments
path:
Array
the path to set
val:
*
The new value
obj:
Object
The object to clone
Returns
Object
A new object equivalent to the original except along the specified path.