Packages

dset

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

Your version

12 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.

  1. 3.x · latest line
  2. 3.1.4

    9 Sep 2024
  3. 3.1.3

    25 Oct 2023
    • Add "types" export conditions for TypeScript "nodenext"/"node16" resolution
      Thank you @Akkuma

  4. 3.1.2

    3 May 2022
    • Security

      (dset/merge): Prevent possible prototype pollution (#34): 2d156c7
      Thank you @n1ru4l~!

  5. 3.1.1

    27 Oct 2021
  6. 3.1.0

    24 Feb 2021
    • Added dset/merge submodule: 5aed5d1, 8d0224d, 8ee6d12
      This is an opt-in module, inspired by GraphQL's upcoming @stream and @defer directives.
      The purpose of this submodule is to merge mutations from multiple sources into a single payload. It will merge new values into existing/previous values, whereas dset (main mode) will replace values at the specified key-path outright. In code, this difference roughly translates to this distinction:

      // dset (main)
      target.key = { value: 'new value' };
      
      // dset/merge
      Object.assign(target.key, { value: 'new value' })

      See Merging and test/suites/objects.js for more information.

  7. 3.0.0

    28 Jan 2021
    • 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.

  8. 2.x
  9. 2.1.0

    27 Jan 2021
    • Security

      Protect against prototype pollution: a4b8a93
      Skip assignments to keys named __proto__, constructor, or prototype.
      Versions between 1.0.0 and 2.0.1 (inclusive) are now marked as deprecated.
      Thank you @arjunshibu~!

    • Added TypeScript definitions (#18, #19): e3a48de, bcbe1c1
      Thank you @maraisr~!

  10. 2.0.1

    8 Sep 2018
    • Prevent Array creation with Float-like keys (#11): 2b9ec49

  11. 2.0.0

    7 Sep 2018
    • Breaking

      NEW Write into or create new Arrays with numeric path segments (#9): e6fea6f

      Thank you @bwendt-mylo 🎉

      let qux = {};
      dset(qux, 'a.0.b.0', 1);
      dset(qux, 'a.0.b.1', 2);
      //=> { a: [{ b: [1, 2] }] }
  12. 1.x
  13. 1.0.0 – 1.0.12 releases without a noteShow each
  14. 0.0.x
  15. 0.0.0

    21 Feb 2018

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.