Open
Description
Some test cases you may want to add.
https://replit.com/@trajano/lodash#index.js
const _ = require('lodash');
const set = require('set-value');
const spec = {
a: "foo",
b: { x: 12, y: 11 },
c: [
{ x: 11, y: 11 },
{ x: 22, y: 22 },
// for keys that are strings which are
// reserved so simple splits can't be used
{ "foo[0].1": 22, "e.y": 22 },
],
};
console.log(spec)
const c = _.cloneDeep(spec)
_.set(c, 'b.x', 99);
_.set(c, 'c[1].y', 99);
_.set(c, "c[2]['foo[0].1']", 199);
console.log(c)
const d = _.cloneDeep(spec)
set(d, 'b.x', 99);
set(d, 'c[1].y', 99);
set(d, "c[2]['foo[0].1']", 199);
console.log(d)
Metadata
Metadata
Assignees
Labels
No labels