aboutsummaryrefslogtreecommitdiff
path: root/node_modules/ajv/lib/compile/equal.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/ajv/lib/compile/equal.js')
-rw-r--r--node_modules/ajv/lib/compile/equal.js44
1 files changed, 1 insertions, 43 deletions
diff --git a/node_modules/ajv/lib/compile/equal.js b/node_modules/ajv/lib/compile/equal.js
index 2a918746c..911774c85 100644
--- a/node_modules/ajv/lib/compile/equal.js
+++ b/node_modules/ajv/lib/compile/equal.js
@@ -1,45 +1,3 @@
'use strict';
-/*eslint complexity: 0*/
-
-module.exports = function equal(a, b) {
- if (a === b) return true;
-
- var arrA = Array.isArray(a)
- , arrB = Array.isArray(b)
- , i;
-
- if (arrA && arrB) {
- if (a.length != b.length) return false;
- for (i = 0; i < a.length; i++)
- if (!equal(a[i], b[i])) return false;
- return true;
- }
-
- if (arrA != arrB) return false;
-
- if (a && b && typeof a === 'object' && typeof b === 'object') {
- var keys = Object.keys(a);
- if (keys.length !== Object.keys(b).length) return false;
-
- var dateA = a instanceof Date
- , dateB = b instanceof Date;
- if (dateA && dateB) return a.getTime() == b.getTime();
- if (dateA != dateB) return false;
-
- var regexpA = a instanceof RegExp
- , regexpB = b instanceof RegExp;
- if (regexpA && regexpB) return a.toString() == b.toString();
- if (regexpA != regexpB) return false;
-
- for (i = 0; i < keys.length; i++)
- if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;
-
- for (i = 0; i < keys.length; i++)
- if(!equal(a[keys[i]], b[keys[i]])) return false;
-
- return true;
- }
-
- return false;
-};
+module.exports = require('fast-deep-equal');