Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

keyarray-set

Package Overview
Dependencies
1
Maintainers
1
Versions
3
Issues
File Explorer

Advanced tools

keyarray-set

set nested properties with key arrays

    1.0.1latest
    GitHub

Version published
Maintainers
1
Weekly downloads
628
increased by10.95%

Weekly downloads

Readme

Source
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)

Keywords

FAQs

Last updated on 10 Sep 2016

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.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc