Packages

dset

3.1.4 · 9 Sep 2024MIT24.3M / weekRepositoryHomepagenpmAtom feed

Your version

3.0.0

major28 Jan 2021Where it was published

3.1.4 is the newest release of 3.x.

In short

3 breaking2 new5 internal

  • Breaking

    Overwrites existing, non-object values as needed: 569955d Now dset is inline with lodash/set and set-value behaviors

  • Breaking

    Use named dset export instead of default export: 7ac17ed

  • Breaking

    Exit loop when unsafe key(s) encountered (#22): 0a11c8a Previously, as of v2.1.0, dset skipped over the offending key, but continued processing those after it. Now dset matches the lodash/set behavior, abandoning the current dset() execution entirely.

Security

2 advisories affect 3.0.0; 3.1.4 fixes them

Release note

Breaking

  • Breaking

    Overwrites existing, non-object values as needed: 569955d
    Now dset is inline with lodash/set and set-value behaviors

    let input = { foo: 123 };
    
    dset(input, 'foo.bar', 456);
    console.log(input);
    //=> (Before) { foo: 123 } -- no change
    //=> (After) { foo: { bar: 456 } } -- convert "foo" to object
  • Breaking

    Use named dset export instead of default export: 7ac17ed

    -import dset from 'dset';
    +import { dset } from 'dset';
  • Breaking

    Exit loop when unsafe key(s) encountered (#22): 0a11c8a
    Previously, as of v2.1.0, dset skipped over the offending key, but continued processing those after it.
    Now dset matches the lodash/set behavior, abandoning the current dset() execution entirely.

Features

  • Add "exports" map for native ESM support: fa7ab74

  • Add support for keys with number type (#12): 5b09e52
    Previously, dset(input, ['foo', 1], 123) failed because 1 was a number.
    Now, ['foo', 1] is treated the same as ['foo', '1'] and 'foo.1'

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.