keyarray-set
Advanced tools
Weekly downloads
Readme
var set = require('keyarray-set')
var assert = require('assert')
var anObject = {
a: {
b: {}
}
}
assert(set(anObject, ['a', 'b', 'c'], 'new value') === 'new value')
assert(anObject.a.b.hasOwnProperty('c') === true)
assert(anObject.a.b.c === 'new value')
assert.throws(function () {
set(anObject, ['nonexistent', 'key'], 'another value')
}, TypeError)
FAQs
set nested properties with key arrays
The npm package keyarray-set receives a total of 469 weekly downloads. As such, keyarray-set popularity was classified as not popular.
We found that keyarray-set demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.