Home

Awesome

upsert-value NPM version Build Status

Update or set nested values and any intermediaries with dot notation ('a.b.c') paths.

Install with npm

$ npm i upsert-value --save

Usage

var upsert = require('upsert-value');

API

<!-- add a path or glob pattern for files with code comments to use for docs -->

upsert

Update or set a value on the given object with the given key path.

Params

Example

var obj = {};
upsert(obj, 'a.b.c', 'foo');
//=> {a: {b: {c: 'foo'}}}

Related projects

<!-- add an array of related projects, then un-escape the helper -->

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Brian Woodward

License

Copyright © 2015 Brian Woodward Released under the MIT license.


This file was generated by verb-cli on July 09, 2015.