Bachir Soussi Chiadmi ac58a24f5c added bower, gulp | 7 rokov pred | |
---|---|---|
.. | ||
LICENSE | 7 rokov pred | |
README.md | 7 rokov pred | |
index.js | 7 rokov pred | |
package.json | 7 rokov pred |
Does a shallow comparison of two objects, returning false if the keys or values differ.
The purpose of this lib is to do the fastest comparison possible of two objects when the values will predictably be primitives.
false
is returned.Install with npm
$ npm i is-equal-shallow --save
var equals = require('is-equal-shallow');
equals(object_a, object_b);
Examples
equals({a: true, b: true}, {a: true, b: true});
//=> 'true'
equals({a: true, b: false}, {c: false, b: false});
//=> 'false'
equals({a: true, b: false}, {a: false, b: false});
//=> 'false'
Strict comparison for equality:
equals({a: true, b: true}, {a: true, b: 'true'});
//=> 'false'
When values are not primitives, false
is always returned:
equals({ b: {}}, { b: {}});
//=> 'false'
equals({ b: []}, { b: []});
//=> 'false'
Other object utils:
Object
constructor.Install dev dependencies:
$ npm i -d && npm test
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Jon Schlinkert
Copyright © 2015 Jon Schlinkert Released under the MIT license.
This file was generated by verb-cli on June 22, 2015.