1.0.9 • Published 2 years ago

@marcm/deep-equal v1.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@marcm/deep-equal

Mighty fast deep equals (~837 bytes gzipped)

Install

npm install @marcm/deep-equal
yarn add @marcm/deep-equal

Supports

  • Object
  • Array
  • TypedArray
  • RegExp
  • Promise
  • Date
  • NaN
  • Set
  • Map
  • React (@marcm/deep-equal/react)

Benchmark^1 (from fast-equals)

^1: showing benchmark 'overall averages'. Ran on an M1 Pro (macOS 12.4). Run yourself by adding @marcm/deep-equal to the fast-equals benchmark

PackageOps / sec
@marcm/deep-equal11,294.928
fast-equals7,317.215
deep-eql4,528.424
fast-equals (circular)2,966.189
fast-deep-equal2,841.046
react-fast-compare2,684.473
nano-equal1,150.366
underscore.isEqual1,107.566
lodash.isEqual673.473
assert.deepStrictEqual30.697
deep-equal2.888

Passes the full test suite of fast-equals

Usage

const { deepEqual } = require('@marcm/deep-equal')
// or
import { deepEqual } from '@marcm/deep-equal'
// or if being used for React
import { deepEqual } from '@marcm/deep-equal/react'

// Typed Arrays
deepEqual(new Float32Array([3, 4, 6]), new Float32Array([3, 4, 6])) // true
deepEqual(new Float32Array([3, 4, 6]), new Float32Array([3, 4])) // false
// Objects and array
deepEqual([{ a: 'a' }, { b: 'b' }], [{ a: 'a' }, { b: 'b' }]) // true
// Dates
deepEqual(new Date('2017-06-16T21:36:48.362Z'), new Date('2016-06-16T21:36:48.362Z')) // false
deepEqual(new Date('2017-06-16T21:36:48.362Z'), new Date('2017-06-16T21:36:48.362Z')) // true
1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago