deep-equal
node's assert.deepEqual algorithm
Last updated a year ago by ljharb .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install deep-equal 
SYNC missed versions from official npm registry.

deep-equal Version Badge

Node's assert.deepEqual() algorithm as a standalone module, that also works in browser environments.

It mirrors the robustness of node's own assert.deepEqual and is robust against later builtin modification.

github actions coverage License Downloads

npm badge

example

var equal = require('deep-equal');
console.dir([
    equal(
        { a : [ 2, 3 ], b : [ 4 ] },
        { a : [ 2, 3 ], b : [ 4 ] }
    ),
    equal(
        { x : 5, y : [6] },
        { x : 5, y : 6 }
    )
]);

methods

var deepEqual = require('deep-equal')

deepEqual(a, b, opts)

Compare objects a and b, returning whether they are equal according to a recursive equality algorithm.

If opts.strict is true, use strict equality (===) to compare leaf nodes. The default is to use coercive equality (==) because that's how assert.deepEqual() works by default.

install

With npm do:

npm install deep-equal

test

With npm do:

npm test

Current Tags

  • 2.2.3                                ...           latest (a year ago)
  • 1.1.2                                ...           v1-backport (a year ago)

22 Versions

  • 2.2.3                                ...           a year ago
  • 1.1.2                                ...           a year ago
  • 2.2.2                                ...           a year ago
  • 2.2.1                                ...           2 years ago
  • 2.2.0                                ...           2 years ago
  • 2.1.0                                ...           2 years ago
  • 2.0.5                                ...           4 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           5 years ago
  • 2.0.2                                ...           5 years ago
  • 2.0.1                                ...           5 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           9 years ago
  • 1.0.0                                ...           10 years ago
  • 0.2.2                                ...           10 years ago
  • 0.2.1                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
  • 0.0.0                                ...           13 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (16)

Copyright 2013 - present © cnpmjs.org | Home |