Package Exports
- deep-setter
- deep-setter/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (deep-setter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
deep-setter
sets a value deep in an object
#Install
npm install deep-setter --save
#Usage
var setter = require('deep-setter');
//setter is a function that takes (originObject, deepValueAnnotation, value)
If You:
setter({}, 'an.[@1].arbitrary.[@0].address', 'value')
Result:
{ an : [, { arbitrary : [ { address : 'value'} ] } ] } );
If You:
setter({}, 'an.1.arbitrary.0.address', 'value')
Result:
{ an : { 1 : { arbitrary : { 0 : { address : 'value'} } } } } );
If You:
setter({}, 'an.arbitrary.address', { test : 'value'})
Result:
{ an : { arbitrary : { address : { test : 'value' }} } } );