Skip to content

Releases: lukeed/dset

v3.1.3

25 Oct 18:31
Compare
Choose a tag to compare

Patches

  • Add "types" export conditions for TypeScript "nodenext"/"node16" resolution: #40
    Thank you @Akkuma

Full Changelog: v3.1.2...v3.1.3

v3.1.2

03 May 16:03
Compare
Choose a tag to compare

Patches

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

Chores


Full Changelog: v3.1.1...v3.1.2

v3.1.1

27 Oct 00:58
Compare
Choose a tag to compare

Patches

Chores

  • Update module sizes: c29c251
    Changes from #29 saved 2B from dset and 1B from dset/merge 😆

Full Changelog: v3.1.0...v3.1.1

v3.1.0

24 Feb 17:36
Compare
Choose a tag to compare

Features

  • 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.

Chores

  • Attach bundt multi-mode setup: 36a2529, 7932211
  • Separate test suites for composability & reuse: 9f337a8

v3.0.0

28 Jan 19:40
Compare
Choose a tag to compare

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
  • Use named dset export instead of default export: 7ac17ed

    -import dset from 'dset';
    +import { dset } from 'dset';
  • 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'

Chores

v2.1.0

27 Jan 08:32
Compare
Choose a tag to compare

Features

Patches

  • 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~!

Chores

v2.0.1

08 Sep 20:26
Compare
Choose a tag to compare

Patches

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

Chores

v2.0.0

07 Sep 05:48
Compare
Choose a tag to compare

Major Changes

  • 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] }] }

Chores

  • Added UMD bundle (#7): f53a456

    Also made available via http://unpkg.com/dset