assert.deepEqual()'s strict East Coast siblings with engineering backgrounds,
only-shallow is their laid-back California cousin.
only-shallow is a
cyclical data structures, is written to avoid try / catch / throw (for speed),
and has no dependencies. It's not particularly strict about matching types.
It's more of a duck squeezer.
It has some optimizations but stresses correctness over raw speed. Unlike
deepest, it has no native dependencies, so you can use it, like, wherever.
I like to think the documentation is pretty OK.
only-shallow has this name because I'm
npm install only-shallow
var deepEqual =if ! console;
Copied from the source, here are the details of
==) only for value types (non-objects). This is the biggest difference between
only-shallowcares more about shape and contents than type. This step will also catch functions, with the useful (default) property that only references to the same function are considered equal. 'Ware the halting problem!
nullis an object – a singleton value object, in fact – so if either is
null, return a == b. For the purposes of
only-shallow, loose testing of emptiness makes sense.
bto be an object, if
bis not an object, they're clearly not the same.
.getTime()) than by lexical value.
bboth have no properties.
bhave the same number of own properties (which is what
ISC. Go nuts.