summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/fast-deep-equal/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/fast-deep-equal/index.js')
-rw-r--r--deps/npm/node_modules/fast-deep-equal/index.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/deps/npm/node_modules/fast-deep-equal/index.js b/deps/npm/node_modules/fast-deep-equal/index.js
deleted file mode 100644
index 7aaaba3f6c..0000000000
--- a/deps/npm/node_modules/fast-deep-equal/index.js
+++ /dev/null
@@ -1,55 +0,0 @@
-'use strict';
-
-var isArray = Array.isArray;
-var keyList = Object.keys;
-var hasProp = Object.prototype.hasOwnProperty;
-
-module.exports = function equal(a, b) {
- if (a === b) return true;
-
- var arrA = isArray(a)
- , arrB = isArray(b)
- , i
- , length
- , key;
-
- if (arrA && arrB) {
- length = a.length;
- if (length != b.length) return false;
- for (i = 0; i < length; i++)
- if (!equal(a[i], b[i])) return false;
- return true;
- }
-
- if (arrA != arrB) return false;
-
- var dateA = a instanceof Date
- , dateB = b instanceof Date;
- if (dateA != dateB) return false;
- if (dateA && dateB) return a.getTime() == b.getTime();
-
- var regexpA = a instanceof RegExp
- , regexpB = b instanceof RegExp;
- if (regexpA != regexpB) return false;
- if (regexpA && regexpB) return a.toString() == b.toString();
-
- if (a instanceof Object && b instanceof Object) {
- var keys = keyList(a);
- length = keys.length;
-
- if (length !== keyList(b).length)
- return false;
-
- for (i = 0; i < length; i++)
- if (!hasProp.call(b, keys[i])) return false;
-
- for (i = 0; i < length; i++) {
- key = keys[i];
- if (!equal(a[key], b[key])) return false;
- }
-
- return true;
- }
-
- return false;
-};