assign-set
TypeScript icon, indicating that this package has built-in type declarations

1.1.9 • Public • Published

assign-set

Base on lodash.set, But the difference between Array and Array-like object

const assignSet = require('assign-set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: { 2: { c: 'value' } } };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

The difference of lodash.set

const lodash = require('lodash.set');

assignSet(obj, 'a.2.c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

assignSet(obj, 'a[2].c', 'value');
obj = { a: [undefined, undefined, { c: 'value' }] };

Readme

Keywords

none

Package Sidebar

Install

npm i assign-set

Weekly Downloads

63

Version

1.1.9

License

MIT

Unpacked Size

27.7 kB

Total Files

4

Last publish

Collaborators

  • noyobo