lodash-setall

2.0.0 • Public • Published

lodash-setall [Build Status]

Uses lodash get/set pathing to map values from one object into another:

var _setAll = require('lodash-setall');

var origin = {
  'b': 'something',
  'c': { d: [0,1,2,3,4]},
  'd': { 'foo': 'bar' }
};

var map = {
  'a':'b',
  'b':'c.d.2',
  'c.a':'d'
};

var result = _setAll(origin, map, {});
// result = {
//   'a': 'something',
//   'b': 2,
//   'c': { 'a': { 'foo': 'bar'} }
//

For details on how the pathing works, see the documentation for .get and .set.

Readme

Keywords

Package Sidebar

Install

npm i lodash-setall

Weekly Downloads

1

Version

2.0.0

License

MIT

Unpacked Size

6.13 kB

Total Files

6

Last publish

Collaborators

  • mrhen