Move a property from one object to another.
Install with npm
$ npm i move-property --save
var move = require('move-property');
Examples
Move a property:
var one = {a: 'b'};
var two = {};
move(one, two, 'a');
console.log(one);
//=> {}
console.log(two)
//=> {a: 'b'}
Move a nested property:
var one = {a: {b: 'c'}};
var two = {};
move(one, two, 'a.b');
console.log(one);
//=> {a: {}}
console.log(two);
//=> {a: {b: 'c'}}
a.b.c) to get a nested value from an object. | homepage'a.b.c') paths. | homepageInstall dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on October 31, 2015.