A less shallow `only-shallow`
$ cnpm install not-so-shallow
A less shallow
only-shallow
This is just only-shallow but with strict equality for value types.
$ npm install --save not-so-shallow
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
Returns true if a and b are the same according to the algorithm, which is
explained in the comments of index.js.
MIT © Juan Soto
Copyright 2013 - present © cnpmjs.org | Home |