Skip to content

Replacements for deep-equal

util.isDeepStrictEqual (native, since Node.js v9.0.0)

Node.js has a builtin function isDeepStrictEqual. Consider using that if you don’t need browser support.

Example:

ts
import equal from 'deep-equal'
import { isDeepStrictEqual } from 'node:util'

const a = { foo: 'bar' }
const b = { foo: 'bar' }

equal(a, b) // true
isDeepStrictEqual(a, b) // true

dequal

dequal has the same simple API as deep-equal.

Example:

ts
import equal from 'deep-equal'
import dequal from 'dequal'

const a = { foo: 'bar' }
const b = { foo: 'bar' }

equal(a, b) // true
dequal(a, b) // true

Released under the MIT License. (65e83b3b)