You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Michael Winter 555e2c196e | 6 years ago | |
---|---|---|
.. | ||
index.js | 6 years ago | |
license | 6 years ago | |
package.json | 6 years ago | |
readme.md | 6 years ago |
readme.md
not-so-shallow
A less shallow
only-shallow
This is just only-shallow
but with strict equality for value types.
Install
$ npm install --save not-so-shallow
Usage
let notSoShallow = require('not-so-shallow')
notSoShallow({a: 0}, {a: false}) // false
notSoShallow({a: 0}, {a: '0'}) // false
notSoShallow({a: 1}, {a: 1}) // true
notSoShallow({a: 1, b: 2}, {b: 2, a: 1}) // true
API
notSoShallow(a, b)
Returns true
if a
and b
are the same according to the algorithm, which is
explained in the comments of index.js
.
License
MIT © Juan Soto