v3.0.0
Breaking
-
Overwrites existing, non-object values as needed: 569955d
Nowdsetis inline withlodash/setandset-valuebehaviorslet input = { foo: 123 }; dset(input, 'foo.bar', 456); console.log(input); //=> (Before) { foo: 123 } -- no change //=> (After) { foo: { bar: 456 } } -- convert "foo" to object
-
Use named
dsetexport instead ofdefaultexport: 7ac17ed-import dset from 'dset'; +import { dset } from 'dset';
-
Exit loop when unsafe key(s) encountered (#22): 0a11c8a
Previously, as of v2.1.0,dsetskipped over the offending key, but continued processing those after it.
Nowdsetmatches thelodash/setbehavior, abandoning the currentdset()execution entirely.
Features
- Add
"exports"map for native ESM support: fa7ab74 - Add support for keys with
numbertype (#12): 5b09e52
Previously,dset(input, ['foo', 1], 123)failed because1was a number.
Now,['foo', 1]is treated the same as['foo', '1']and'foo.1'