fast-equals 1.6.3 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,464 +1,309 @@
1
1
  (function (global, factory) {
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
3
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = global || self, factory(global['fast-equals'] = {}));
5
- }(this, function (exports) { 'use strict';
6
-
7
- /**
8
- * @constant {boolean} HAS_MAP_SUPPORT
9
- */
10
- var HAS_MAP_SUPPORT = typeof Map === 'function';
11
- /**
12
- * @constant {boolean} HAS_SET_SUPPORT
13
- */
14
-
15
- var HAS_SET_SUPPORT = typeof Set === 'function';
16
- /**
17
- * @constant {boolean} HAS_WEAKSET_SUPPORT
18
- */
19
-
20
- var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';
21
-
22
- // constants
23
- var keys = Object.keys;
24
- /**
25
- * @function addObjectToCache
26
- *
27
- * @description
28
- * add object to cache if it is indeed an object
29
- *
30
- * @param {any} object the object to potentially add to the cache
31
- * @param {Object|WeakSet} cache the cache to add to
32
- * @returns {void}
33
- */
34
-
35
- var addObjectToCache = function addObjectToCache(object, cache) {
36
- return object && typeof object === 'object' && cache.add(object);
37
- };
38
- /**
39
- *
40
- * @param {Array<Array<any>>} pairs the pairs to check in
41
- * @param {Array<any>} pairToMatch the pair to check if exists
42
- * @param {function} isEqual the equality comparator
43
- * @param {any} meta the meta item to pass through
44
- * @returns {boolean} does the pair exist in the pairs
45
- */
46
-
47
- var hasPair = function hasPair(pairs, pairToMatch, isEqual, meta) {
48
- var pair;
49
-
50
- for (var index = 0; index < pairs.length; index++) {
51
- pair = pairs[index];
52
-
53
- if (isEqual(pair[0], pairToMatch[0], meta) && isEqual(pair[1], pairToMatch[1], meta)) {
54
- return true;
55
- }
56
- }
57
-
58
- return false;
59
- };
60
- /**
61
- * @function hasValue
62
- *
63
- * @description
64
- * does the values include the vakye passed
65
- *
66
- * @param {Array<any>} values the values to check in
67
- * @param {any} item the value to locate
68
- * @param {function} isEqual the equality comparator
69
- * @param {any} meta the meta item to pass through
70
- * @returns {boolean} does the value exist in the values
71
- */
72
-
73
- var hasValue = function hasValue(values, item, isEqual, meta) {
74
- for (var index = 0; index < values.length; index++) {
75
- if (isEqual(values[index], item, meta)) {
76
- return true;
77
- }
78
- }
79
-
80
- return false;
81
- };
82
- /**
83
- * @function sameValueZeroEqual
84
- *
85
- * @description
86
- * are the objects passed strictly equal or both NaN
87
- *
88
- * @param {any} objectA the object to compare against
89
- * @param {any} objectB the object to test
90
- * @returns {boolean} are the objects equal by the SameValueZero principle
91
- */
92
-
93
- var sameValueZeroEqual = function sameValueZeroEqual(objectA, objectB) {
94
- return objectA === objectB || objectA !== objectA && objectB !== objectB;
95
- };
96
- /**
97
- * @function isPlainObject
98
- *
99
- * @description
100
- * is the object a plain object
101
- *
102
- * @param {any} object the object to test
103
- * @returns {boolean} is the object a plain object
104
- */
105
-
106
- var isPlainObject = function isPlainObject(object) {
107
- return object.constructor === Object;
108
- };
109
- /**
110
- * @function isPromiseLike
111
- *
112
- * @description
113
- * is the object promise-like (thenable)
114
- *
115
- * @param {any} object the object to test
116
- * @returns {boolean} is the object promise-like
117
- */
118
-
119
- var isPromiseLike = function isPromiseLike(object) {
120
- return typeof object.then === 'function';
121
- };
122
- /**
123
- * @function isReactElement
124
- *
125
- * @description
126
- * is the object passed a react element
127
- *
128
- * @param {any} object the object to test
129
- * @returns {boolean} is the object a react element
130
- */
131
-
132
- var isReactElement = function isReactElement(object) {
133
- return !!(object.$$typeof && object._store);
134
- };
135
- /**
136
- * @function getNewCache
137
- *
138
- * @description
139
- * get a new cache object to prevent circular references
140
- *
141
- * @returns {Object|Weakset} the new cache object
142
- */
143
-
144
- var getNewCache = function getNewCache() {
145
- return HAS_WEAKSET_SUPPORT ? new WeakSet() : Object.create({
146
- _values: [],
147
- add: function add(value) {
148
- this._values.push(value);
149
- },
150
- has: function has(value) {
151
- return !!~this._values.indexOf(value);
152
- }
153
- });
154
- };
155
- /**
156
- * @function createCircularEqual
157
- *
158
- * @description
159
- * create a custom isEqual handler specific to circular objects
160
- *
161
- * @param {funtion} [isEqual] the isEqual comparator to use instead of isDeepEqual
162
- * @returns {function(any, any): boolean}
163
- */
164
-
165
- var createCircularEqual = function createCircularEqual(isEqual) {
166
- return function (isDeepEqual) {
167
- var comparator = isEqual || isDeepEqual;
168
- return function (objectA, objectB, cache) {
169
- if (cache === void 0) {
170
- cache = getNewCache();
171
- }
172
-
173
- var cacheHasA = cache.has(objectA);
174
- var cacheHasB = cache.has(objectB);
175
-
176
- if (cacheHasA || cacheHasB) {
177
- return cacheHasA && cacheHasB;
178
- }
179
-
180
- addObjectToCache(objectA, cache);
181
- addObjectToCache(objectB, cache);
182
- return comparator(objectA, objectB, cache);
183
- };
184
- };
185
- };
186
- /**
187
- * @function toPairs
188
- *
189
- * @param {Map} map the map to convert to [key, value] pairs (entries)
190
- * @returns {Array<Array<*>>} the [key, value] pairs
191
- */
192
-
193
- var toPairs = function toPairs(map) {
194
- var pairs = [];
195
- map.forEach(function (value, key) {
196
- return pairs.push([key, value]);
197
- });
198
- return pairs;
199
- };
200
- /**
201
- * @function toValues
202
- *
203
- * @param {Set} set the set to convert to values
204
- * @returns {Array<*>} the values
205
- */
206
-
207
- var toValues = function toValues(set) {
208
- var values = [];
209
- set.forEach(function (value) {
210
- return values.push(value);
211
- });
212
- return values;
213
- };
214
- /**
215
- * @function areArraysEqual
216
- *
217
- * @description
218
- * are the arrays equal in value
219
- *
220
- * @param {Array<any>} arrayA the array to test
221
- * @param {Array<any>} arrayB the array to test against
222
- * @param {function} isEqual the comparator to determine equality
223
- * @param {any} meta the meta object to pass through
224
- * @returns {boolean} are the arrays equal
225
- */
226
-
227
- var areArraysEqual = function areArraysEqual(arrayA, arrayB, isEqual, meta) {
228
- if (arrayA.length !== arrayB.length) {
229
- return false;
230
- }
231
-
232
- for (var index = 0; index < arrayA.length; index++) {
233
- if (!isEqual(arrayA[index], arrayB[index], meta)) {
234
- return false;
235
- }
236
- }
237
-
238
- return true;
239
- };
240
- /**
241
- * @function areMapsEqual
242
- *
243
- * @description
244
- * are the maps equal in value
245
- *
246
- * @param {Map} mapA the map to test
247
- * @param {Map} mapB the map to test against
248
- * @param {function} isEqual the comparator to determine equality
249
- * @param {any} meta the meta map to pass through
250
- * @returns {boolean} are the maps equal
251
- */
252
-
253
- var areMapsEqual = function areMapsEqual(mapA, mapB, isEqual, meta) {
254
- if (mapA.size !== mapB.size) {
255
- return false;
256
- }
257
-
258
- var pairsA = toPairs(mapA);
259
- var pairsB = toPairs(mapB);
260
-
261
- for (var index = 0; index < pairsA.length; index++) {
262
- if (!hasPair(pairsB, pairsA[index], isEqual, meta) || !hasPair(pairsA, pairsB[index], isEqual, meta)) {
263
- return false;
264
- }
265
- }
266
-
267
- return true;
268
- };
269
- /**
270
- * @function areObjectsEqual
271
- *
272
- * @description
273
- * are the objects equal in value
274
- *
275
- * @param {Object} objectA the object to test
276
- * @param {Object} objectB the object to test against
277
- * @param {function} isEqual the comparator to determine equality
278
- * @param {any} meta the meta object to pass through
279
- * @returns {boolean} are the objects equal
280
- */
281
-
282
- var areObjectsEqual = function areObjectsEqual(objectA, objectB, isEqual, meta) {
283
- var keysA = keys(objectA);
284
- var keysB = keys(objectB);
285
-
286
- if (keysA.length !== keysB.length) {
287
- return false;
288
- }
289
-
290
- var key;
291
-
292
- for (var index = 0; index < keysA.length; index++) {
293
- key = keysA[index];
294
-
295
- if (!hasValue(keysB, key, sameValueZeroEqual)) {
296
- return false;
297
- } // if a react element, ignore the "_owner" key because its not necessary for equality comparisons
298
-
299
-
300
- if (key === '_owner' && isReactElement(objectA) && isReactElement(objectB)) {
301
- continue;
302
- }
303
-
304
- if (!isEqual(objectA[key], objectB[key], meta)) {
305
- return false;
306
- }
307
- }
308
-
309
- return true;
310
- };
311
- /**
312
- * @function areRegExpsEqual
313
- *
314
- * @description
315
- * are the regExps equal in value
316
- *
317
- * @param {RegExp} regExpA the regExp to test
318
- * @param {RegExp} regExpB the regExp to test agains
319
- * @returns {boolean} are the regExps equal
320
- */
321
-
322
- var areRegExpsEqual = function areRegExpsEqual(regExpA, regExpB) {
323
- return regExpA.source === regExpB.source && regExpA.global === regExpB.global && regExpA.ignoreCase === regExpB.ignoreCase && regExpA.multiline === regExpB.multiline && regExpA.unicode === regExpB.unicode && regExpA.sticky === regExpB.sticky && regExpA.lastIndex === regExpB.lastIndex;
324
- };
325
- /**
326
- * @function areSetsEqual
327
- *
328
- * @description
329
- * are the sets equal in value
330
- *
331
- * @param {Set} setA the set to test
332
- * @param {Set} setB the set to test against
333
- * @param {function} isEqual the comparator to determine equality
334
- * @param {any} meta the meta set to pass through
335
- * @returns {boolean} are the sets equal
336
- */
337
-
338
- var areSetsEqual = function areSetsEqual(setA, setB, isEqual, meta) {
339
- if (setA.size !== setB.size) {
340
- return false;
341
- }
342
-
343
- var valuesA = toValues(setA);
344
- var valuesB = toValues(setB);
345
-
346
- for (var index = 0; index < valuesA.length; index++) {
347
- if (!hasValue(valuesB, valuesA[index], isEqual, meta) || !hasValue(valuesA, valuesB[index], isEqual, meta)) {
348
- return false;
349
- }
350
- }
351
-
352
- return true;
353
- };
354
-
355
- // constants
356
- var isArray = Array.isArray;
357
-
358
- var createComparator = function createComparator(createIsEqual) {
359
- // eslint-disable-next-line no-use-before-define
360
- var isEqual = typeof createIsEqual === 'function' ? createIsEqual(comparator) : comparator;
361
- /**
362
- * @function comparator
363
- *
364
- * @description
365
- * compare the value of the two objects and return true if they are equivalent in values
366
- *
367
- * @param {any} objectA the object to test against
368
- * @param {any} objectB the object to test
369
- * @param {any} [meta] an optional meta object that is passed through to all equality test calls
370
- * @returns {boolean} are objectA and objectB equivalent in value
371
- */
372
-
373
- function comparator(objectA, objectB, meta) {
374
- if (sameValueZeroEqual(objectA, objectB)) {
375
- return true;
376
- }
377
-
378
- var typeOfA = typeof objectA;
379
-
380
- if (typeOfA !== typeof objectB || typeOfA !== 'object' || !objectA || !objectB) {
381
- return false;
382
- }
383
-
384
- if (isPlainObject(objectA) && isPlainObject(objectB)) {
385
- return areObjectsEqual(objectA, objectB, isEqual, meta);
386
- }
387
-
388
- var arrayA = isArray(objectA);
389
- var arrayB = isArray(objectB);
390
-
391
- if (arrayA || arrayB) {
392
- return arrayA === arrayB && areArraysEqual(objectA, objectB, isEqual, meta);
393
- }
394
-
395
- var dateA = objectA instanceof Date;
396
- var dateB = objectB instanceof Date;
397
-
398
- if (dateA || dateB) {
399
- return dateA === dateB && sameValueZeroEqual(objectA.getTime(), objectB.getTime());
400
- }
401
-
402
- var regexpA = objectA instanceof RegExp;
403
- var regexpB = objectB instanceof RegExp;
404
-
405
- if (regexpA || regexpB) {
406
- return regexpA === regexpB && areRegExpsEqual(objectA, objectB);
407
- }
408
-
409
- if (isPromiseLike(objectA) || isPromiseLike(objectB)) {
410
- return objectA === objectB;
411
- }
412
-
413
- if (HAS_MAP_SUPPORT) {
414
- var mapA = objectA instanceof Map;
415
- var mapB = objectB instanceof Map;
416
-
417
- if (mapA || mapB) {
418
- return mapA === mapB && areMapsEqual(objectA, objectB, isEqual, meta);
419
- }
420
- }
421
-
422
- if (HAS_SET_SUPPORT) {
423
- var setA = objectA instanceof Set;
424
- var setB = objectB instanceof Set;
425
-
426
- if (setA || setB) {
427
- return setA === setB && areSetsEqual(objectA, objectB, isEqual, meta);
428
- }
429
- }
430
-
431
- return areObjectsEqual(objectA, objectB, isEqual, meta);
432
- }
433
-
434
- return comparator;
435
- };
436
-
437
- // comparator
438
- var circularDeepEqual = createComparator(createCircularEqual());
439
- var circularShallowEqual = createComparator(createCircularEqual(sameValueZeroEqual));
440
- var deepEqual = createComparator();
441
- var shallowEqual = createComparator(function () {
442
- return sameValueZeroEqual;
443
- });
444
- var index = {
445
- circularDeep: circularDeepEqual,
446
- circularShallow: circularShallowEqual,
447
- createCustom: createComparator,
448
- deep: deepEqual,
449
- sameValueZero: sameValueZeroEqual,
450
- shallow: shallowEqual
451
- };
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['fast-equals'] = {}));
5
+ }(this, (function (exports) { 'use strict';
6
+
7
+ var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';
8
+ var keys = Object.keys;
9
+ /**
10
+ * are the values passed strictly equal or both NaN
11
+ *
12
+ * @param a the value to compare against
13
+ * @param b the value to test
14
+ * @returns are the values equal by the SameValueZero principle
15
+ */
16
+ function sameValueZeroEqual(a, b) {
17
+ return a === b || (a !== a && b !== b);
18
+ }
19
+ /**
20
+ * is the value a plain object
21
+ *
22
+ * @param value the value to test
23
+ * @returns is the value a plain object
24
+ */
25
+ function isPlainObject(value) {
26
+ return value.constructor === Object || value.constructor == null;
27
+ }
28
+ /**
29
+ * is the value promise-like (meaning it is thenable)
30
+ *
31
+ * @param value the value to test
32
+ * @returns is the value promise-like
33
+ */
34
+ function isPromiseLike(value) {
35
+ return !!value && typeof value.then === 'function';
36
+ }
37
+ /**
38
+ * is the value passed a react element
39
+ *
40
+ * @param value the value to test
41
+ * @returns is the value a react element
42
+ */
43
+ function isReactElement(value) {
44
+ return !!(value && value.$$typeof);
45
+ }
46
+ /**
47
+ * in cases where WeakSet is not supported, creates a new custom
48
+ * object that mimics the necessary API aspects for cache purposes
49
+ *
50
+ * @returns the new cache object
51
+ */
52
+ function getNewCacheFallback() {
53
+ var values = [];
54
+ return {
55
+ add: function (value) {
56
+ values.push(value);
57
+ },
58
+ has: function (value) {
59
+ return values.indexOf(value) !== -1;
60
+ },
61
+ };
62
+ }
63
+ /**
64
+ * get a new cache object to prevent circular references
65
+ *
66
+ * @returns the new cache object
67
+ */
68
+ var getNewCache = (function (canUseWeakMap) {
69
+ if (canUseWeakMap) {
70
+ return function _getNewCache() {
71
+ return new WeakSet();
72
+ };
73
+ }
74
+ return getNewCacheFallback;
75
+ })(HAS_WEAKSET_SUPPORT);
76
+ /**
77
+ * create a custom isEqual handler specific to circular objects
78
+ *
79
+ * @param [isEqual] the isEqual comparator to use instead of isDeepEqual
80
+ * @returns the method to create the `isEqual` function
81
+ */
82
+ function createCircularEqualCreator(isEqual) {
83
+ return function createCircularEqual(comparator) {
84
+ var _comparator = isEqual || comparator;
85
+ return function circularEqual(a, b, cache) {
86
+ if (cache === void 0) { cache = getNewCache(); }
87
+ var isCacheableA = !!a && typeof a === 'object';
88
+ var isCacheableB = !!b && typeof b === 'object';
89
+ if (isCacheableA || isCacheableB) {
90
+ var hasA = isCacheableA && cache.has(a);
91
+ var hasB = isCacheableB && cache.has(b);
92
+ if (hasA || hasB) {
93
+ return hasA && hasB;
94
+ }
95
+ if (isCacheableA) {
96
+ cache.add(a);
97
+ }
98
+ if (isCacheableB) {
99
+ cache.add(b);
100
+ }
101
+ }
102
+ return _comparator(a, b, cache);
103
+ };
104
+ };
105
+ }
106
+ /**
107
+ * are the arrays equal in value
108
+ *
109
+ * @param a the array to test
110
+ * @param b the array to test against
111
+ * @param isEqual the comparator to determine equality
112
+ * @param meta the meta object to pass through
113
+ * @returns are the arrays equal
114
+ */
115
+ function areArraysEqual(a, b, isEqual, meta) {
116
+ var index = a.length;
117
+ if (b.length !== index) {
118
+ return false;
119
+ }
120
+ while (index-- > 0) {
121
+ if (!isEqual(a[index], b[index], meta)) {
122
+ return false;
123
+ }
124
+ }
125
+ return true;
126
+ }
127
+ /**
128
+ * are the maps equal in value
129
+ *
130
+ * @param a the map to test
131
+ * @param b the map to test against
132
+ * @param isEqual the comparator to determine equality
133
+ * @param meta the meta map to pass through
134
+ * @returns are the maps equal
135
+ */
136
+ function areMapsEqual(a, b, isEqual, meta) {
137
+ var isValueEqual = a.size === b.size;
138
+ if (isValueEqual && a.size) {
139
+ a.forEach(function (aValue, aKey) {
140
+ if (isValueEqual) {
141
+ isValueEqual = false;
142
+ b.forEach(function (bValue, bKey) {
143
+ if (!isValueEqual && isEqual(aKey, bKey, meta)) {
144
+ isValueEqual = isEqual(aValue, bValue, meta);
145
+ }
146
+ });
147
+ }
148
+ });
149
+ }
150
+ return isValueEqual;
151
+ }
152
+ var OWNER = '_owner';
153
+ var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);
154
+ /**
155
+ * are the objects equal in value
156
+ *
157
+ * @param a the object to test
158
+ * @param b the object to test against
159
+ * @param isEqual the comparator to determine equality
160
+ * @param meta the meta object to pass through
161
+ * @returns are the objects equal
162
+ */
163
+ function areObjectsEqual(a, b, isEqual, meta) {
164
+ var keysA = keys(a);
165
+ var index = keysA.length;
166
+ if (keys(b).length !== index) {
167
+ return false;
168
+ }
169
+ if (index) {
170
+ var key = void 0;
171
+ while (index-- > 0) {
172
+ key = keysA[index];
173
+ if (key === OWNER) {
174
+ var reactElementA = isReactElement(a);
175
+ var reactElementB = isReactElement(b);
176
+ if ((reactElementA || reactElementB) &&
177
+ reactElementA !== reactElementB) {
178
+ return false;
179
+ }
180
+ }
181
+ if (!hasOwnProperty(b, key) || !isEqual(a[key], b[key], meta)) {
182
+ return false;
183
+ }
184
+ }
185
+ }
186
+ return true;
187
+ }
188
+ /**
189
+ * are the regExps equal in value
190
+ *
191
+ * @param a the regExp to test
192
+ * @param b the regExp to test agains
193
+ * @returns are the regExps equal
194
+ */
195
+ function areRegExpsEqual(a, b) {
196
+ return (a.source === b.source &&
197
+ a.global === b.global &&
198
+ a.ignoreCase === b.ignoreCase &&
199
+ a.multiline === b.multiline &&
200
+ a.unicode === b.unicode &&
201
+ a.sticky === b.sticky &&
202
+ a.lastIndex === b.lastIndex);
203
+ }
204
+ /**
205
+ * are the sets equal in value
206
+ *
207
+ * @param a the set to test
208
+ * @param b the set to test against
209
+ * @param isEqual the comparator to determine equality
210
+ * @param meta the meta set to pass through
211
+ * @returns are the sets equal
212
+ */
213
+ function areSetsEqual(a, b, isEqual, meta) {
214
+ var isValueEqual = a.size === b.size;
215
+ if (isValueEqual && a.size) {
216
+ a.forEach(function (aValue) {
217
+ if (isValueEqual) {
218
+ isValueEqual = false;
219
+ b.forEach(function (bValue) {
220
+ if (!isValueEqual) {
221
+ isValueEqual = isEqual(aValue, bValue, meta);
222
+ }
223
+ });
224
+ }
225
+ });
226
+ }
227
+ return isValueEqual;
228
+ }
229
+
230
+ var HAS_MAP_SUPPORT = typeof Map === 'function';
231
+ var HAS_SET_SUPPORT = typeof Set === 'function';
232
+ function createComparator(createIsEqual) {
233
+ var isEqual =
234
+ /* eslint-disable no-use-before-define */
235
+ typeof createIsEqual === 'function'
236
+ ? createIsEqual(comparator)
237
+ : comparator;
238
+ /* eslint-enable */
239
+ /**
240
+ * compare the value of the two objects and return true if they are equivalent in values
241
+ *
242
+ * @param a the value to test against
243
+ * @param b the value to test
244
+ * @param [meta] an optional meta object that is passed through to all equality test calls
245
+ * @returns are a and b equivalent in value
246
+ */
247
+ function comparator(a, b, meta) {
248
+ if (a === b) {
249
+ return true;
250
+ }
251
+ if (a && b && typeof a === 'object' && typeof b === 'object') {
252
+ if (isPlainObject(a) && isPlainObject(b)) {
253
+ return areObjectsEqual(a, b, isEqual, meta);
254
+ }
255
+ var aShape = Array.isArray(a);
256
+ var bShape = Array.isArray(b);
257
+ if (aShape || bShape) {
258
+ return aShape === bShape && areArraysEqual(a, b, isEqual, meta);
259
+ }
260
+ aShape = a instanceof Date;
261
+ bShape = b instanceof Date;
262
+ if (aShape || bShape) {
263
+ return (aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime()));
264
+ }
265
+ aShape = a instanceof RegExp;
266
+ bShape = b instanceof RegExp;
267
+ if (aShape || bShape) {
268
+ return aShape === bShape && areRegExpsEqual(a, b);
269
+ }
270
+ if (isPromiseLike(a) || isPromiseLike(b)) {
271
+ return a === b;
272
+ }
273
+ if (HAS_MAP_SUPPORT) {
274
+ aShape = a instanceof Map;
275
+ bShape = b instanceof Map;
276
+ if (aShape || bShape) {
277
+ return aShape === bShape && areMapsEqual(a, b, isEqual, meta);
278
+ }
279
+ }
280
+ if (HAS_SET_SUPPORT) {
281
+ aShape = a instanceof Set;
282
+ bShape = b instanceof Set;
283
+ if (aShape || bShape) {
284
+ return aShape === bShape && areSetsEqual(a, b, isEqual, meta);
285
+ }
286
+ }
287
+ return areObjectsEqual(a, b, isEqual, meta);
288
+ }
289
+ return a !== a && b !== b;
290
+ }
291
+ return comparator;
292
+ }
293
+
294
+ var deepEqual = createComparator();
295
+ var shallowEqual = createComparator(function () { return sameValueZeroEqual; });
296
+ var circularDeepEqual = createComparator(createCircularEqualCreator());
297
+ var circularShallowEqual = createComparator(createCircularEqualCreator(sameValueZeroEqual));
452
298
 
453
299
  exports.circularDeepEqual = circularDeepEqual;
454
300
  exports.circularShallowEqual = circularShallowEqual;
455
301
  exports.createCustomEqual = createComparator;
456
302
  exports.deepEqual = deepEqual;
457
- exports.default = index;
458
303
  exports.sameValueZeroEqual = sameValueZeroEqual;
459
304
  exports.shallowEqual = shallowEqual;
460
305
 
461
306
  Object.defineProperty(exports, '__esModule', { value: true });
462
307
 
463
- }));
308
+ })));
464
309
  //# sourceMappingURL=fast-equals.js.map