@nathanfaucett/shallow_equals
v0.0.2
Published
shallow check for equality
Downloads
4
Maintainers
Readme
shallow_equals
shallow check for equality
var shallowEquals = require("@nathanfaucett/shallow_equals");
shallowEquals(0, 0) === true;
shallowEquals(0, 1) === false;
shallowEquals("string", "string") === true;
shallowEquals("string", "diff_string") === false;
shallowEquals([0, 1, 2], [0, 1, 2]) === true;
shallowEquals([0, 1, 2], [0, 1, 2, 3]) === false;
shallowEquals([0, 1, 2], [0, 1]) === false;
shallowEquals({a: 0, b: 1}, {a: 0, b: 1}) === true;
shallowEquals({a: 0, b: 1}, {a: 0, b: 1, c: 2}) === false;
shallowEquals({a: 0, b: 1}, {a: 0})