dset icon indicating copy to clipboard operation
dset copied to clipboard

`dset` throws when encountering `null` in object

Open bgoscinski opened this issue 3 years ago • 0 comments

This test currently fails:

  objects(`should ${verb} null values`, () => {
    let { input } = prepare({ hello: null });

    dset(input, ['hello', 'a'], 123);

    assert.equal(input, {
      hello: { a: 123 },
    });
  });

with:

   FAIL  objects  "should overwrite null values"
    Cannot set properties of null (setting 'a')

lodash.set correctly overwrites null.

bgoscinski avatar Apr 24 '22 12:04 bgoscinski