deep-equal
node's assert.deepEqual algorithm
Last updated 3 years ago by ljharb .
MIT · Repository · Bugs · Original npm
$ cnpm install deep-equal 
SYNC missed versions from official npm registry.

deep-equal Version Badge

Node's assert.deepEqual() algorithm as a standalone module.

This module is around 46 times faster than wrapping assert.deepEqual() in a try/catch.

github actions coverage dependency status dev dependency status 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.0                                ...           latest (3 years ago)
  • 2.0.3                                ...           next (5 years ago)

8 Versions

  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           3 years ago
  • 2.0.5                                ...           5 years ago
  • 0.1.2                                ...           12 years ago
  • 2.0.3                                ...           5 years ago
  • 0.2.2                                ...           11 years ago
  • 1.0.1                                ...           10 years ago
  • 1.1.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (13)
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org