Skip to content

v2.0.0

Compare
Choose a tag to compare
@lukeed lukeed released this 12 Aug 23:50
· 10 commits to master since this release

Breaking

  • Migrated from default to named export: 88f7ec5

    ESM/TypeScript

    - import dequal from 'dequal';
    + import { dequal } from 'dequal';

    CommonJS

    - const dequal = require('dequal');
    + const { dequal } = require('dequal');
  • Dropped Internet Explorer support
    If IE9+ support is still needed, please use the new dequal/lite entry (see below).
    The dequal/lite code is identical to dequal@1.x.

Features

  • Added ArrayBuffer and TypeArray support to dequal entry: cf14422

  • Added Map and Set support to dequal entry: ef34745, 0f081ab
    Set values, Map values, and Map keys use deep value equality.

    Example

    const foo = new Map([
      [{ abc: 123 }, 'value']
    ]);
    
    const bar = new Map([
      [{ abc: 123 }, 'value']
    ]);

    With referential equality, foo and bar are not equal. Even though they look identical, their { abc: 123 } key is not a shared reference. However, with value equality, foo and bar are equal. This is because their { abc: 123 } key holds the same value –– this follows how dequal and dequal/lite compare any other object.

  • Added native ESM support via exports mapping: 3533248
    Allows for Node.js import statements to work within native ESM resolvers.

  • Added dequal/lite mode: 81075b1
    Preserves dequal@1.x behaviors, allowing opt-in, continued IE support.
    Unlike the primary dequal offering, this mode does not & will not support Maps, Sets, TypedArray, etc.

Chores