Commit project
This commit is contained in:
parent
28471965a0
commit
3ac017a5ad
1030 changed files with 94062 additions and 0 deletions
27
node_modules/is-equal-shallow/index.js
generated
vendored
Normal file
27
node_modules/is-equal-shallow/index.js
generated
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
/*!
|
||||
* is-equal-shallow <https://github.com/jonschlinkert/is-equal-shallow>
|
||||
*
|
||||
* Copyright (c) 2015, Jon Schlinkert.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var isPrimitive = require('is-primitive');
|
||||
|
||||
module.exports = function isEqual(a, b) {
|
||||
if (!a && !b) { return true; }
|
||||
if (!a && b || a && !b) { return false; }
|
||||
|
||||
var numKeysA = 0, numKeysB = 0, key;
|
||||
for (key in b) {
|
||||
numKeysB++;
|
||||
if (!isPrimitive(b[key]) || !a.hasOwnProperty(key) || (a[key] !== b[key])) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (key in a) {
|
||||
numKeysA++;
|
||||
}
|
||||
return numKeysA === numKeysB;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue