deepy
v0.1.2
Published
A fast algorithm for comparing equality of values with strict equality for value types.
Downloads
2
Maintainers
Readme
Deepy
A fast algorithm for value comparison and equality of value types.
It's build for performance, and supports ES6 primitives among other things.
Loosely based on algorithms from NodeJS, Jasmine, Lodash and others.
Install
$ npm install --save deepy
Usage
Returns either true or false depends if the values are the same according to the algorithm or not.
let deepy = require('deepy')
deepy({a: 0}, {a: false}) // false
deepy(['a'], {0: 'a'}) // false
deepy({a: 1}, {a: 1}) // true
deepy('/a/igmm', '/a/igm') // false
deepy(
[
{foo: {z: 100, y: 200, x: 300}},
'bar',
11,
{baz: {d: 4, a: 1, b: 2, c: 3}}
],
[
{foo: {z: 100, y: 200, x: 300}},
'bar',
11,
{baz: {d: 4, a: 1, b: 2, c: 3}}
]
) // true