fast-deep-equal
Fast deep equal
Last updated 5 years ago by esp .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install fast-deep-equal 
SYNC missed versions from official npm registry.

fast-deep-equal

The fastest deep equal

Build Status npm npm Coverage Status

This readme is for pre-release v3 with ES6 Map, Set and Typed arrays support.

See branch v2 for the main version.

Install

To install v3 pre-release with ES6 Map, Set and Typed arrays support

npm install fast-deep-equal@beta

To install v2

npm install fast-deep-equal

Features

  • ES5 compatible
  • works in node.js (8+) and browsers (IE9+)
  • checks equality of Date and RegExp objects by value.

ES6 equal (require('fast-deep-equal/es6')) also supports:

  • Maps
  • Sets
  • Typed arrays

Usage

var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true

To support ES6 Maps, Sets and Typed arrays equality use:

var equal = require('fast-deep-equal/es6');
console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true

Performance benchmark

Node.js v12.6.0:

fast-deep-equal x 325,485 ops/sec ±0.57% (86 runs sampled)
fast-deep-equal/es6 x 261,338 ops/sec ±0.45% (89 runs sampled)
nano-equal x 231,064 ops/sec ±0.62% (88 runs sampled)
shallow-equal-fuzzy x 164,828 ops/sec ±0.87% (88 runs sampled)
underscore.isEqual x 91,247 ops/sec ±0.56% (88 runs sampled)
lodash.isEqual x 48,000 ops/sec ±0.48% (86 runs sampled)
deep-equal x 73,699 ops/sec ±0.55% (86 runs sampled)
deep-eql x 42,804 ops/sec ±0.45% (87 runs sampled)
ramda.equals x 15,119 ops/sec ±0.49% (87 runs sampled)
util.isDeepStrictEqual x 58,458 ops/sec ±0.56% (89 runs sampled)
assert.deepStrictEqual x 583 ops/sec ±0.47% (87 runs sampled)

The fastest is fast-deep-equal

To run benchmark (requires node.js 6+):

npm run benchmark

License

MIT

Current Tags

  • 3.0.0-beta.2                                ...           beta (5 years ago)
  • 3.1.3                                ...           latest (4 years ago)

14 Versions

  • 3.1.3                                ...           4 years ago
  • 3.1.1                                ...           5 years ago
  • 3.1.0                                ...           5 years ago
  • 3.0.1                                ...           5 years ago
  • 3.0.0                                ...           5 years ago
  • 3.0.0-beta.2                                ...           5 years ago
  • 3.0.0-beta.1                                ...           5 years ago
  • 3.0.0-beta.0                                ...           5 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago

© 2010 - cnpmjs.org x YWFE | Home | YWFE