fast-equals 2.0.1 → 3.0.0
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.
- package/CHANGELOG.md +49 -3
- package/README.md +58 -37
- package/dist/fast-equals.cjs.js +106 -213
- package/dist/fast-equals.cjs.js.map +1 -1
- package/dist/fast-equals.esm.js +106 -213
- package/dist/fast-equals.esm.js.map +1 -1
- package/dist/fast-equals.js +108 -215
- package/dist/fast-equals.js.map +1 -1
- package/dist/fast-equals.min.js +1 -1
- package/dist/fast-equals.mjs +106 -213
- package/dist/fast-equals.mjs.map +1 -1
- package/index.d.ts +10 -1
- package/package.json +40 -41
package/dist/fast-equals.cjs.js
CHANGED
|
@@ -5,69 +5,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';
|
|
6
6
|
var keys = Object.keys;
|
|
7
7
|
/**
|
|
8
|
-
* @function addToCache
|
|
9
|
-
*
|
|
10
|
-
* add object to cache if an object
|
|
11
|
-
*
|
|
12
|
-
* @param value the value to potentially add to cache
|
|
13
|
-
* @param cache the cache to add to
|
|
14
|
-
*/
|
|
15
|
-
function addToCache(value, cache) {
|
|
16
|
-
if (value && typeof value === 'object') {
|
|
17
|
-
cache.add(value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* @function hasPair
|
|
22
|
-
*
|
|
23
|
-
* @description
|
|
24
|
-
* does the `pairToMatch` exist in the list of `pairs` provided based on the
|
|
25
|
-
* `isEqual` check
|
|
26
|
-
*
|
|
27
|
-
* @param pairs the pairs to compare against
|
|
28
|
-
* @param pairToMatch the pair to match
|
|
29
|
-
* @param isEqual the equality comparator used
|
|
30
|
-
* @param meta the meta provided
|
|
31
|
-
* @returns does the pair exist in the pairs provided
|
|
32
|
-
*/
|
|
33
|
-
function hasPair(pairs, pairToMatch, isEqual, meta) {
|
|
34
|
-
var length = pairs.length;
|
|
35
|
-
var pair;
|
|
36
|
-
for (var index = 0; index < length; index++) {
|
|
37
|
-
pair = pairs[index];
|
|
38
|
-
if (isEqual(pair[0], pairToMatch[0], meta) &&
|
|
39
|
-
isEqual(pair[1], pairToMatch[1], meta)) {
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* @function hasValue
|
|
47
|
-
*
|
|
48
|
-
* @description
|
|
49
|
-
* does the `valueToMatch` exist in the list of `values` provided based on the
|
|
50
|
-
* `isEqual` check
|
|
51
|
-
*
|
|
52
|
-
* @param values the values to compare against
|
|
53
|
-
* @param valueToMatch the value to match
|
|
54
|
-
* @param isEqual the equality comparator used
|
|
55
|
-
* @param meta the meta provided
|
|
56
|
-
* @returns does the value exist in the values provided
|
|
57
|
-
*/
|
|
58
|
-
function hasValue(values, valueToMatch, isEqual, meta) {
|
|
59
|
-
var length = values.length;
|
|
60
|
-
for (var index = 0; index < length; index++) {
|
|
61
|
-
if (isEqual(values[index], valueToMatch, meta)) {
|
|
62
|
-
return true;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return false;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* @function sameValueZeroEqual
|
|
69
|
-
*
|
|
70
|
-
* @description
|
|
71
8
|
* are the values passed strictly equal or both NaN
|
|
72
9
|
*
|
|
73
10
|
* @param a the value to compare against
|
|
@@ -78,9 +15,6 @@ function sameValueZeroEqual(a, b) {
|
|
|
78
15
|
return a === b || (a !== a && b !== b);
|
|
79
16
|
}
|
|
80
17
|
/**
|
|
81
|
-
* @function isPlainObject
|
|
82
|
-
*
|
|
83
|
-
* @description
|
|
84
18
|
* is the value a plain object
|
|
85
19
|
*
|
|
86
20
|
* @param value the value to test
|
|
@@ -90,9 +24,6 @@ function isPlainObject(value) {
|
|
|
90
24
|
return value.constructor === Object || value.constructor == null;
|
|
91
25
|
}
|
|
92
26
|
/**
|
|
93
|
-
* @function isPromiseLike
|
|
94
|
-
*
|
|
95
|
-
* @description
|
|
96
27
|
* is the value promise-like (meaning it is thenable)
|
|
97
28
|
*
|
|
98
29
|
* @param value the value to test
|
|
@@ -102,9 +33,6 @@ function isPromiseLike(value) {
|
|
|
102
33
|
return !!value && typeof value.then === 'function';
|
|
103
34
|
}
|
|
104
35
|
/**
|
|
105
|
-
* @function isReactElement
|
|
106
|
-
*
|
|
107
|
-
* @description
|
|
108
36
|
* is the value passed a react element
|
|
109
37
|
*
|
|
110
38
|
* @param value the value to test
|
|
@@ -114,29 +42,23 @@ function isReactElement(value) {
|
|
|
114
42
|
return !!(value && value.$$typeof);
|
|
115
43
|
}
|
|
116
44
|
/**
|
|
117
|
-
* @function getNewCacheFallback
|
|
118
|
-
*
|
|
119
|
-
* @description
|
|
120
45
|
* in cases where WeakSet is not supported, creates a new custom
|
|
121
46
|
* object that mimics the necessary API aspects for cache purposes
|
|
122
47
|
*
|
|
123
48
|
* @returns the new cache object
|
|
124
49
|
*/
|
|
125
50
|
function getNewCacheFallback() {
|
|
126
|
-
|
|
127
|
-
|
|
51
|
+
var values = [];
|
|
52
|
+
return {
|
|
128
53
|
add: function (value) {
|
|
129
|
-
|
|
54
|
+
values.push(value);
|
|
130
55
|
},
|
|
131
56
|
has: function (value) {
|
|
132
|
-
return
|
|
57
|
+
return values.indexOf(value) !== -1;
|
|
133
58
|
},
|
|
134
|
-
}
|
|
59
|
+
};
|
|
135
60
|
}
|
|
136
61
|
/**
|
|
137
|
-
* @function getNewCache
|
|
138
|
-
*
|
|
139
|
-
* @description
|
|
140
62
|
* get a new cache object to prevent circular references
|
|
141
63
|
*
|
|
142
64
|
* @returns the new cache object
|
|
@@ -150,9 +72,6 @@ var getNewCache = (function (canUseWeakMap) {
|
|
|
150
72
|
return getNewCacheFallback;
|
|
151
73
|
})(HAS_WEAKSET_SUPPORT);
|
|
152
74
|
/**
|
|
153
|
-
* @function createCircularEqualCreator
|
|
154
|
-
*
|
|
155
|
-
* @description
|
|
156
75
|
* create a custom isEqual handler specific to circular objects
|
|
157
76
|
*
|
|
158
77
|
* @param [isEqual] the isEqual comparator to use instead of isDeepEqual
|
|
@@ -161,57 +80,28 @@ var getNewCache = (function (canUseWeakMap) {
|
|
|
161
80
|
function createCircularEqualCreator(isEqual) {
|
|
162
81
|
return function createCircularEqual(comparator) {
|
|
163
82
|
var _comparator = isEqual || comparator;
|
|
164
|
-
return function circularEqual(a, b, cache) {
|
|
83
|
+
return function circularEqual(a, b, indexOrKeyA, indexOrKeyB, parentA, parentB, cache) {
|
|
165
84
|
if (cache === void 0) { cache = getNewCache(); }
|
|
166
|
-
var
|
|
167
|
-
var
|
|
168
|
-
if (
|
|
169
|
-
|
|
85
|
+
var isCacheableA = !!a && typeof a === 'object';
|
|
86
|
+
var isCacheableB = !!b && typeof b === 'object';
|
|
87
|
+
if (isCacheableA || isCacheableB) {
|
|
88
|
+
var hasA = isCacheableA && cache.has(a);
|
|
89
|
+
var hasB = isCacheableB && cache.has(b);
|
|
90
|
+
if (hasA || hasB) {
|
|
91
|
+
return hasA && hasB;
|
|
92
|
+
}
|
|
93
|
+
if (isCacheableA) {
|
|
94
|
+
cache.add(a);
|
|
95
|
+
}
|
|
96
|
+
if (isCacheableB) {
|
|
97
|
+
cache.add(b);
|
|
98
|
+
}
|
|
170
99
|
}
|
|
171
|
-
addToCache(a, cache);
|
|
172
|
-
addToCache(b, cache);
|
|
173
100
|
return _comparator(a, b, cache);
|
|
174
101
|
};
|
|
175
102
|
};
|
|
176
103
|
}
|
|
177
104
|
/**
|
|
178
|
-
* @function toPairs
|
|
179
|
-
*
|
|
180
|
-
* @description
|
|
181
|
-
* convert the map passed into pairs (meaning an array of [key, value] tuples)
|
|
182
|
-
*
|
|
183
|
-
* @param map the map to convert to [key, value] pairs (entries)
|
|
184
|
-
* @returns the [key, value] pairs
|
|
185
|
-
*/
|
|
186
|
-
function toPairs(map) {
|
|
187
|
-
var pairs = new Array(map.size);
|
|
188
|
-
var index = 0;
|
|
189
|
-
map.forEach(function (value, key) {
|
|
190
|
-
pairs[index++] = [key, value];
|
|
191
|
-
});
|
|
192
|
-
return pairs;
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* @function toValues
|
|
196
|
-
*
|
|
197
|
-
* @description
|
|
198
|
-
* convert the set passed into values
|
|
199
|
-
*
|
|
200
|
-
* @param set the set to convert to values
|
|
201
|
-
* @returns the values
|
|
202
|
-
*/
|
|
203
|
-
function toValues(set) {
|
|
204
|
-
var values = new Array(set.size);
|
|
205
|
-
var index = 0;
|
|
206
|
-
set.forEach(function (value) {
|
|
207
|
-
values[index++] = value;
|
|
208
|
-
});
|
|
209
|
-
return values;
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* @function areArraysEqual
|
|
213
|
-
*
|
|
214
|
-
* @description
|
|
215
105
|
* are the arrays equal in value
|
|
216
106
|
*
|
|
217
107
|
* @param a the array to test
|
|
@@ -221,21 +111,18 @@ function toValues(set) {
|
|
|
221
111
|
* @returns are the arrays equal
|
|
222
112
|
*/
|
|
223
113
|
function areArraysEqual(a, b, isEqual, meta) {
|
|
224
|
-
var
|
|
225
|
-
if (b.length !==
|
|
114
|
+
var index = a.length;
|
|
115
|
+
if (b.length !== index) {
|
|
226
116
|
return false;
|
|
227
117
|
}
|
|
228
|
-
|
|
229
|
-
if (!isEqual(a[index], b[index], meta)) {
|
|
118
|
+
while (index-- > 0) {
|
|
119
|
+
if (!isEqual(a[index], b[index], index, index, a, b, meta)) {
|
|
230
120
|
return false;
|
|
231
121
|
}
|
|
232
122
|
}
|
|
233
123
|
return true;
|
|
234
124
|
}
|
|
235
125
|
/**
|
|
236
|
-
* @function areMapsEqual
|
|
237
|
-
*
|
|
238
|
-
* @description
|
|
239
126
|
* are the maps equal in value
|
|
240
127
|
*
|
|
241
128
|
* @param a the map to test
|
|
@@ -245,26 +132,34 @@ function areArraysEqual(a, b, isEqual, meta) {
|
|
|
245
132
|
* @returns are the maps equal
|
|
246
133
|
*/
|
|
247
134
|
function areMapsEqual(a, b, isEqual, meta) {
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
135
|
+
var isValueEqual = a.size === b.size;
|
|
136
|
+
if (isValueEqual && a.size) {
|
|
137
|
+
var matchedIndices_1 = {};
|
|
138
|
+
var indexA_1 = 0;
|
|
139
|
+
a.forEach(function (aValue, aKey) {
|
|
140
|
+
if (isValueEqual) {
|
|
141
|
+
var hasMatch_1 = false;
|
|
142
|
+
var matchIndexB_1 = 0;
|
|
143
|
+
b.forEach(function (bValue, bKey) {
|
|
144
|
+
if (!hasMatch_1 && !matchedIndices_1[matchIndexB_1]) {
|
|
145
|
+
hasMatch_1 =
|
|
146
|
+
isEqual(aKey, bKey, indexA_1, matchIndexB_1, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta);
|
|
147
|
+
if (hasMatch_1) {
|
|
148
|
+
matchedIndices_1[matchIndexB_1] = true;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
matchIndexB_1++;
|
|
152
|
+
});
|
|
153
|
+
indexA_1++;
|
|
154
|
+
isValueEqual = hasMatch_1;
|
|
155
|
+
}
|
|
156
|
+
});
|
|
259
157
|
}
|
|
260
|
-
return
|
|
158
|
+
return isValueEqual;
|
|
261
159
|
}
|
|
262
160
|
var OWNER = '_owner';
|
|
263
161
|
var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Object.prototype.hasOwnProperty);
|
|
264
162
|
/**
|
|
265
|
-
* @function areObjectsEqual
|
|
266
|
-
*
|
|
267
|
-
* @description
|
|
268
163
|
* are the objects equal in value
|
|
269
164
|
*
|
|
270
165
|
* @param a the object to test
|
|
@@ -275,31 +170,30 @@ var hasOwnProperty = Function.prototype.bind.call(Function.prototype.call, Objec
|
|
|
275
170
|
*/
|
|
276
171
|
function areObjectsEqual(a, b, isEqual, meta) {
|
|
277
172
|
var keysA = keys(a);
|
|
278
|
-
var
|
|
279
|
-
if (keys(b).length !==
|
|
173
|
+
var index = keysA.length;
|
|
174
|
+
if (keys(b).length !== index) {
|
|
280
175
|
return false;
|
|
281
176
|
}
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
177
|
+
if (index) {
|
|
178
|
+
var key = void 0;
|
|
179
|
+
while (index-- > 0) {
|
|
180
|
+
key = keysA[index];
|
|
181
|
+
if (key === OWNER) {
|
|
182
|
+
var reactElementA = isReactElement(a);
|
|
183
|
+
var reactElementB = isReactElement(b);
|
|
184
|
+
if ((reactElementA || reactElementB) &&
|
|
185
|
+
reactElementA !== reactElementB) {
|
|
186
|
+
return false;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
if (!hasOwnProperty(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) {
|
|
290
190
|
return false;
|
|
291
191
|
}
|
|
292
192
|
}
|
|
293
|
-
else if (!isEqual(a[key], b[key], meta)) {
|
|
294
|
-
return false;
|
|
295
|
-
}
|
|
296
193
|
}
|
|
297
194
|
return true;
|
|
298
195
|
}
|
|
299
196
|
/**
|
|
300
|
-
* @function areRegExpsEqual
|
|
301
|
-
*
|
|
302
|
-
* @description
|
|
303
197
|
* are the regExps equal in value
|
|
304
198
|
*
|
|
305
199
|
* @param a the regExp to test
|
|
@@ -316,9 +210,6 @@ function areRegExpsEqual(a, b) {
|
|
|
316
210
|
a.lastIndex === b.lastIndex);
|
|
317
211
|
}
|
|
318
212
|
/**
|
|
319
|
-
* @function areSetsEqual
|
|
320
|
-
*
|
|
321
|
-
* @description
|
|
322
213
|
* are the sets equal in value
|
|
323
214
|
*
|
|
324
215
|
* @param a the set to test
|
|
@@ -328,36 +219,39 @@ function areRegExpsEqual(a, b) {
|
|
|
328
219
|
* @returns are the sets equal
|
|
329
220
|
*/
|
|
330
221
|
function areSetsEqual(a, b, isEqual, meta) {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
222
|
+
var isValueEqual = a.size === b.size;
|
|
223
|
+
if (isValueEqual && a.size) {
|
|
224
|
+
var matchedIndices_2 = {};
|
|
225
|
+
a.forEach(function (aValue, aKey) {
|
|
226
|
+
if (isValueEqual) {
|
|
227
|
+
var hasMatch_2 = false;
|
|
228
|
+
var matchIndex_1 = 0;
|
|
229
|
+
b.forEach(function (bValue, bKey) {
|
|
230
|
+
if (!hasMatch_2 && !matchedIndices_2[matchIndex_1]) {
|
|
231
|
+
hasMatch_2 = isEqual(aValue, bValue, aKey, bKey, a, b, meta);
|
|
232
|
+
if (hasMatch_2) {
|
|
233
|
+
matchedIndices_2[matchIndex_1] = true;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
matchIndex_1++;
|
|
237
|
+
});
|
|
238
|
+
isValueEqual = hasMatch_2;
|
|
239
|
+
}
|
|
240
|
+
});
|
|
342
241
|
}
|
|
343
|
-
return
|
|
242
|
+
return isValueEqual;
|
|
344
243
|
}
|
|
345
244
|
|
|
346
|
-
var isArray = Array.isArray;
|
|
347
245
|
var HAS_MAP_SUPPORT = typeof Map === 'function';
|
|
348
246
|
var HAS_SET_SUPPORT = typeof Set === 'function';
|
|
349
|
-
var OBJECT_TYPEOF = 'object';
|
|
350
247
|
function createComparator(createIsEqual) {
|
|
351
248
|
var isEqual =
|
|
352
249
|
/* eslint-disable no-use-before-define */
|
|
353
250
|
typeof createIsEqual === 'function'
|
|
354
251
|
? createIsEqual(comparator)
|
|
355
|
-
: comparator;
|
|
252
|
+
: function (a, b, indexOrKeyA, indexOrKeyB, parentA, parentB, meta) { return comparator(a, b, meta); };
|
|
356
253
|
/* eslint-enable */
|
|
357
254
|
/**
|
|
358
|
-
* @function comparator
|
|
359
|
-
*
|
|
360
|
-
* @description
|
|
361
255
|
* compare the value of the two objects and return true if they are equivalent in values
|
|
362
256
|
*
|
|
363
257
|
* @param a the value to test against
|
|
@@ -366,53 +260,52 @@ function createComparator(createIsEqual) {
|
|
|
366
260
|
* @returns are a and b equivalent in value
|
|
367
261
|
*/
|
|
368
262
|
function comparator(a, b, meta) {
|
|
369
|
-
if (
|
|
263
|
+
if (a === b) {
|
|
370
264
|
return true;
|
|
371
265
|
}
|
|
372
|
-
if (a && b && typeof a ===
|
|
266
|
+
if (a && b && typeof a === 'object' && typeof b === 'object') {
|
|
373
267
|
if (isPlainObject(a) && isPlainObject(b)) {
|
|
374
268
|
return areObjectsEqual(a, b, isEqual, meta);
|
|
375
269
|
}
|
|
376
|
-
var
|
|
377
|
-
var
|
|
378
|
-
if (
|
|
379
|
-
return
|
|
270
|
+
var aShape = Array.isArray(a);
|
|
271
|
+
var bShape = Array.isArray(b);
|
|
272
|
+
if (aShape || bShape) {
|
|
273
|
+
return aShape === bShape && areArraysEqual(a, b, isEqual, meta);
|
|
380
274
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
if (
|
|
384
|
-
return
|
|
275
|
+
aShape = a instanceof Date;
|
|
276
|
+
bShape = b instanceof Date;
|
|
277
|
+
if (aShape || bShape) {
|
|
278
|
+
return (aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime()));
|
|
385
279
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
if (
|
|
389
|
-
return
|
|
280
|
+
aShape = a instanceof RegExp;
|
|
281
|
+
bShape = b instanceof RegExp;
|
|
282
|
+
if (aShape || bShape) {
|
|
283
|
+
return aShape === bShape && areRegExpsEqual(a, b);
|
|
390
284
|
}
|
|
391
285
|
if (isPromiseLike(a) || isPromiseLike(b)) {
|
|
392
286
|
return a === b;
|
|
393
287
|
}
|
|
394
288
|
if (HAS_MAP_SUPPORT) {
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
if (
|
|
398
|
-
return
|
|
289
|
+
aShape = a instanceof Map;
|
|
290
|
+
bShape = b instanceof Map;
|
|
291
|
+
if (aShape || bShape) {
|
|
292
|
+
return aShape === bShape && areMapsEqual(a, b, isEqual, meta);
|
|
399
293
|
}
|
|
400
294
|
}
|
|
401
295
|
if (HAS_SET_SUPPORT) {
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
if (
|
|
405
|
-
return
|
|
296
|
+
aShape = a instanceof Set;
|
|
297
|
+
bShape = b instanceof Set;
|
|
298
|
+
if (aShape || bShape) {
|
|
299
|
+
return aShape === bShape && areSetsEqual(a, b, isEqual, meta);
|
|
406
300
|
}
|
|
407
301
|
}
|
|
408
302
|
return areObjectsEqual(a, b, isEqual, meta);
|
|
409
303
|
}
|
|
410
|
-
return
|
|
304
|
+
return a !== a && b !== b;
|
|
411
305
|
}
|
|
412
306
|
return comparator;
|
|
413
307
|
}
|
|
414
308
|
|
|
415
|
-
// comparator
|
|
416
309
|
var deepEqual = createComparator();
|
|
417
310
|
var shallowEqual = createComparator(function () { return sameValueZeroEqual; });
|
|
418
311
|
var circularDeepEqual = createComparator(createCircularEqualCreator());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fast-equals.cjs.js","sources":["../src/utils.ts","../src/comparator.ts","../src/index.ts"],"sourcesContent":["const HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';\n\nconst { keys } = Object;\n\ntype Cache = {\n add: (value: any) => void;\n has: (value: any) => boolean;\n};\n\n/**\n * @function addToCache\n *\n * add object to cache if an object\n *\n * @param value the value to potentially add to cache\n * @param cache the cache to add to\n */\nexport function addToCache(value: any, cache: Cache) {\n if (value && typeof value === 'object') {\n cache.add(value);\n }\n}\n\nexport type EqualityComparator = (a: any, b: any, meta?: any) => boolean;\n\n/**\n * @function hasPair\n *\n * @description\n * does the `pairToMatch` exist in the list of `pairs` provided based on the\n * `isEqual` check\n *\n * @param pairs the pairs to compare against\n * @param pairToMatch the pair to match\n * @param isEqual the equality comparator used\n * @param meta the meta provided\n * @returns does the pair exist in the pairs provided\n */\nexport function hasPair(\n pairs: [any, any][],\n pairToMatch: [any, any],\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = pairs;\n\n let pair: [any, any];\n\n for (let index = 0; index < length; index++) {\n pair = pairs[index];\n\n if (\n isEqual(pair[0], pairToMatch[0], meta) &&\n isEqual(pair[1], pairToMatch[1], meta)\n ) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @function hasValue\n *\n * @description\n * does the `valueToMatch` exist in the list of `values` provided based on the\n * `isEqual` check\n *\n * @param values the values to compare against\n * @param valueToMatch the value to match\n * @param isEqual the equality comparator used\n * @param meta the meta provided\n * @returns does the value exist in the values provided\n */\nexport function hasValue(\n values: any[],\n valueToMatch: any,\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = values;\n\n for (let index = 0; index < length; index++) {\n if (isEqual(values[index], valueToMatch, meta)) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * @function sameValueZeroEqual\n *\n * @description\n * are the values passed strictly equal or both NaN\n *\n * @param a the value to compare against\n * @param b the value to test\n * @returns are the values equal by the SameValueZero principle\n */\nexport function sameValueZeroEqual(a: any, b: any) {\n return a === b || (a !== a && b !== b);\n}\n\n/**\n * @function isPlainObject\n *\n * @description\n * is the value a plain object\n *\n * @param value the value to test\n * @returns is the value a plain object\n */\nexport function isPlainObject(value: any) {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * @function isPromiseLike\n *\n * @description\n * is the value promise-like (meaning it is thenable)\n *\n * @param value the value to test\n * @returns is the value promise-like\n */\nexport function isPromiseLike(value: any) {\n return !!value && typeof value.then === 'function';\n}\n\n/**\n * @function isReactElement\n *\n * @description\n * is the value passed a react element\n *\n * @param value the value to test\n * @returns is the value a react element\n */\nexport function isReactElement(value: any) {\n return !!(value && value.$$typeof);\n}\n\n/**\n * @function getNewCacheFallback\n *\n * @description\n * in cases where WeakSet is not supported, creates a new custom\n * object that mimics the necessary API aspects for cache purposes\n *\n * @returns the new cache object\n */\nexport function getNewCacheFallback(): Cache {\n return Object.create({\n _values: [],\n\n add(value: any) {\n this._values.push(value);\n },\n\n has(value: any) {\n return this._values.indexOf(value) !== -1;\n },\n });\n}\n\n/**\n * @function getNewCache\n *\n * @description\n * get a new cache object to prevent circular references\n *\n * @returns the new cache object\n */\nexport const getNewCache = ((canUseWeakMap: boolean) => {\n if (canUseWeakMap) {\n return function _getNewCache(): Cache {\n return new WeakSet();\n };\n }\n\n return getNewCacheFallback;\n})(HAS_WEAKSET_SUPPORT);\n\n/**\n * @function createCircularEqualCreator\n *\n * @description\n * create a custom isEqual handler specific to circular objects\n *\n * @param [isEqual] the isEqual comparator to use instead of isDeepEqual\n * @returns the method to create the `isEqual` function\n */\nexport function createCircularEqualCreator(isEqual?: EqualityComparator) {\n return function createCircularEqual(comparator: EqualityComparator) {\n const _comparator = isEqual || comparator;\n\n return function circularEqual(\n a: any,\n b: any,\n cache: Cache = getNewCache(),\n ) {\n const hasA = cache.has(a);\n const hasB = cache.has(b);\n\n if (hasA || hasB) {\n return hasA && hasB;\n }\n\n addToCache(a, cache);\n addToCache(b, cache);\n\n return _comparator(a, b, cache);\n };\n };\n}\n\n/**\n * @function toPairs\n *\n * @description\n * convert the map passed into pairs (meaning an array of [key, value] tuples)\n *\n * @param map the map to convert to [key, value] pairs (entries)\n * @returns the [key, value] pairs\n */\nexport function toPairs(map: Map<any, any>): [any, any][] {\n const pairs = new Array(map.size);\n\n let index = 0;\n\n map.forEach((value, key) => {\n pairs[index++] = [key, value];\n });\n\n return pairs;\n}\n\n/**\n * @function toValues\n *\n * @description\n * convert the set passed into values\n *\n * @param set the set to convert to values\n * @returns the values\n */\nexport function toValues(set: Set<any>) {\n const values = new Array(set.size);\n\n let index = 0;\n\n set.forEach((value) => {\n values[index++] = value;\n });\n\n return values;\n}\n\n/**\n * @function areArraysEqual\n *\n * @description\n * are the arrays equal in value\n *\n * @param a the array to test\n * @param b the array to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the arrays equal\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: EqualityComparator,\n meta: any,\n) {\n const { length } = a;\n\n if (b.length !== length) {\n return false;\n }\n\n for (let index = 0; index < length; index++) {\n if (!isEqual(a[index], b[index], meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * @function areMapsEqual\n *\n * @description\n * are the maps equal in value\n *\n * @param a the map to test\n * @param b the map to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta map to pass through\n * @returns are the maps equal\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n if (a.size !== b.size) {\n return false;\n }\n\n const pairsA = toPairs(a);\n const pairsB = toPairs(b);\n\n const { length } = pairsA;\n\n for (let index = 0; index < length; index++) {\n if (\n !hasPair(pairsB, pairsA[index], isEqual, meta) ||\n !hasPair(pairsA, pairsB[index], isEqual, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\ntype Dictionary<Type> = {\n [key: string]: Type;\n [index: number]: Type;\n};\n\nconst OWNER = '_owner';\n\nconst hasOwnProperty = Function.prototype.bind.call(\n Function.prototype.call,\n Object.prototype.hasOwnProperty,\n);\n\n/**\n * @function areObjectsEqual\n *\n * @description\n * are the objects equal in value\n *\n * @param a the object to test\n * @param b the object to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the objects equal\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n const keysA = keys(a);\n\n const { length } = keysA;\n\n if (keys(b).length !== length) {\n return false;\n }\n\n let key: string;\n\n for (let index = 0; index < length; index++) {\n key = keysA[index];\n\n if (!hasOwnProperty(b, key)) {\n return false;\n }\n\n if (key === OWNER && isReactElement(a)) {\n if (!isReactElement(b)) {\n return false;\n }\n } else if (!isEqual(a[key], b[key], meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * @function areRegExpsEqual\n *\n * @description\n * are the regExps equal in value\n *\n * @param a the regExp to test\n * @param b the regExp to test agains\n * @returns are the regExps equal\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.ignoreCase === b.ignoreCase &&\n a.multiline === b.multiline &&\n a.unicode === b.unicode &&\n a.sticky === b.sticky &&\n a.lastIndex === b.lastIndex\n );\n}\n\n/**\n * @function areSetsEqual\n *\n * @description\n * are the sets equal in value\n *\n * @param a the set to test\n * @param b the set to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta set to pass through\n * @returns are the sets equal\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: EqualityComparator,\n meta: any,\n) {\n if (a.size !== b.size) {\n return false;\n }\n\n const valuesA = toValues(a);\n const valuesB = toValues(b);\n\n const { length } = valuesA;\n\n for (let index = 0; index < length; index++) {\n if (\n !hasValue(valuesB, valuesA[index], isEqual, meta) ||\n !hasValue(valuesA, valuesB[index], isEqual, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n","import {\n EqualityComparator,\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n isPlainObject,\n isPromiseLike,\n sameValueZeroEqual,\n} from './utils';\n\nconst { isArray } = Array;\n\nconst HAS_MAP_SUPPORT = typeof Map === 'function';\nconst HAS_SET_SUPPORT = typeof Set === 'function';\n\nconst OBJECT_TYPEOF = 'object';\n\ntype EqualityComparatorCreator = (fn: EqualityComparator) => EqualityComparator;\n\nexport function createComparator(createIsEqual?: EqualityComparatorCreator) {\n const isEqual: EqualityComparator =\n /* eslint-disable no-use-before-define */\n typeof createIsEqual === 'function'\n ? createIsEqual(comparator)\n : comparator;\n /* eslint-enable */\n\n /**\n * @function comparator\n *\n * @description\n * compare the value of the two objects and return true if they are equivalent in values\n *\n * @param a the value to test against\n * @param b the value to test\n * @param [meta] an optional meta object that is passed through to all equality test calls\n * @returns are a and b equivalent in value\n */\n function comparator(a: any, b: any, meta?: any) {\n if (sameValueZeroEqual(a, b)) {\n return true;\n }\n\n if (a && b && typeof a === OBJECT_TYPEOF && typeof b === OBJECT_TYPEOF) {\n if (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n const arrayA = isArray(a);\n const arrayB = isArray(b);\n\n if (arrayA || arrayB) {\n return arrayA === arrayB && areArraysEqual(a, b, isEqual, meta);\n }\n\n const aDate = a instanceof Date;\n const bDate = b instanceof Date;\n\n if (aDate || bDate) {\n return aDate === bDate && sameValueZeroEqual(a.getTime(), b.getTime());\n }\n\n const aRegExp = a instanceof RegExp;\n const bRegExp = b instanceof RegExp;\n\n if (aRegExp || bRegExp) {\n return aRegExp === bRegExp && areRegExpsEqual(a, b);\n }\n\n if (isPromiseLike(a) || isPromiseLike(b)) {\n return a === b;\n }\n\n if (HAS_MAP_SUPPORT) {\n const aMap = a instanceof Map;\n const bMap = b instanceof Map;\n\n if (aMap || bMap) {\n return aMap === bMap && areMapsEqual(a, b, isEqual, meta);\n }\n }\n\n if (HAS_SET_SUPPORT) {\n const aSet = a instanceof Set;\n const bSet = b instanceof Set;\n\n if (aSet || bSet) {\n return aSet === bSet && areSetsEqual(a, b, isEqual, meta);\n }\n }\n\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n return false;\n }\n\n return comparator;\n}\n","// comparator\nimport { createComparator } from './comparator';\n\n// utils\nimport { createCircularEqualCreator, sameValueZeroEqual } from './utils';\n\nexport { createComparator as createCustomEqual, sameValueZeroEqual };\n\nexport const deepEqual = createComparator();\nexport const shallowEqual = createComparator(() => sameValueZeroEqual);\n\nexport const circularDeepEqual = createComparator(createCircularEqualCreator());\nexport const circularShallowEqual = createComparator(\n createCircularEqualCreator(sameValueZeroEqual),\n);\n"],"names":[],"mappings":";;;;AAAA,IAAM,mBAAmB,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BAChB,OAAO,IAAI,KAAK,IAAI,IAAI,YAAY,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;iBAC3D;aACF;YAED,OAAO,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;SAC7C;QAED,OAAO,KAAK,CAAC;KACd;IAED,OAAO,UAAU,CAAC;CACnB;;ACpGD;AACA,IAOa,SAAS,GAAG,gBAAgB,EAAE,CAAC;AAC5C,IAAa,YAAY,GAAG,gBAAgB,CAAC,cAAM,OAAA,kBAAkB,GAAA,CAAC,CAAC;AAEvE,IAAa,iBAAiB,GAAG,gBAAgB,CAAC,0BAA0B,EAAE,CAAC,CAAC;AAChF,IAAa,oBAAoB,GAAG,gBAAgB,CAClD,0BAA0B,CAAC,kBAAkB,CAAC,CAC/C;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"fast-equals.cjs.js","sources":["../src/utils.ts","../src/comparator.ts","../src/index.ts"],"sourcesContent":["const HAS_WEAKSET_SUPPORT = typeof WeakSet === 'function';\n\nconst { keys } = Object;\n\ntype Cache = {\n add: (value: any) => void;\n has: (value: any) => boolean;\n};\n\nexport type InternalEqualityComparator = (\n objectA: any,\n objectB: any,\n indexOrKeyA: any,\n indexOrKeyB: any,\n parentA: any,\n parentB: any,\n meta: any,\n) => boolean;\n\nexport type EqualityComparator = (\n objectA: any,\n objectB: any,\n meta?: any\n) => boolean;\n\n/**\n * are the values passed strictly equal or both NaN\n *\n * @param a the value to compare against\n * @param b the value to test\n * @returns are the values equal by the SameValueZero principle\n */\nexport function sameValueZeroEqual(a: any, b: any) {\n return a === b || (a !== a && b !== b);\n}\n\n/**\n * is the value a plain object\n *\n * @param value the value to test\n * @returns is the value a plain object\n */\nexport function isPlainObject(value: any) {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * is the value promise-like (meaning it is thenable)\n *\n * @param value the value to test\n * @returns is the value promise-like\n */\nexport function isPromiseLike(value: any) {\n return !!value && typeof value.then === 'function';\n}\n\n/**\n * is the value passed a react element\n *\n * @param value the value to test\n * @returns is the value a react element\n */\nexport function isReactElement(value: any) {\n return !!(value && value.$$typeof);\n}\n\n/**\n * in cases where WeakSet is not supported, creates a new custom\n * object that mimics the necessary API aspects for cache purposes\n *\n * @returns the new cache object\n */\nexport function getNewCacheFallback(): Cache {\n const values: any[] = [];\n\n return {\n add(value: any) {\n values.push(value);\n },\n\n has(value: any) {\n return values.indexOf(value) !== -1;\n },\n };\n}\n\n/**\n * get a new cache object to prevent circular references\n *\n * @returns the new cache object\n */\nexport const getNewCache = ((canUseWeakMap: boolean) => {\n if (canUseWeakMap) {\n return function _getNewCache(): Cache {\n return new WeakSet();\n };\n }\n\n return getNewCacheFallback;\n})(HAS_WEAKSET_SUPPORT);\n\n/**\n * create a custom isEqual handler specific to circular objects\n *\n * @param [isEqual] the isEqual comparator to use instead of isDeepEqual\n * @returns the method to create the `isEqual` function\n */\nexport function createCircularEqualCreator(isEqual?: EqualityComparator) {\n return function createCircularEqual(comparator: EqualityComparator): InternalEqualityComparator {\n const _comparator = isEqual || comparator;\n\n return function circularEqual(\n a,\n b,\n indexOrKeyA,\n indexOrKeyB,\n parentA,\n parentB,\n cache: Cache = getNewCache(),\n ) {\n const isCacheableA = !!a && typeof a === 'object';\n const isCacheableB = !!b && typeof b === 'object';\n\n if (isCacheableA || isCacheableB) {\n const hasA = isCacheableA && cache.has(a);\n const hasB = isCacheableB && cache.has(b);\n\n if (hasA || hasB) {\n return hasA && hasB;\n }\n\n if (isCacheableA) {\n cache.add(a);\n }\n\n if (isCacheableB) {\n cache.add(b);\n }\n }\n\n return _comparator(a, b, cache);\n };\n };\n}\n\n/**\n * are the arrays equal in value\n *\n * @param a the array to test\n * @param b the array to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the arrays equal\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator,\n meta: any,\n) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * are the maps equal in value\n *\n * @param a the map to test\n * @param b the map to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta map to pass through\n * @returns are the maps equal\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n isEqual: InternalEqualityComparator,\n meta: any,\n) {\n let isValueEqual = a.size === b.size;\n\n if (isValueEqual && a.size) {\n const matchedIndices: Record<number, true> = {};\n let indexA = 0;\n\n a.forEach((aValue, aKey) => {\n if (isValueEqual) {\n let hasMatch = false;\n let matchIndexB = 0;\n\n b.forEach((bValue, bKey) => {\n if (!hasMatch && !matchedIndices[matchIndexB]) {\n hasMatch =\n isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) && isEqual(aValue, bValue, aKey, bKey, a, b, meta);\n\n if (hasMatch) {\n matchedIndices[matchIndexB] = true;\n }\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n }\n });\n }\n\n return isValueEqual;\n}\n\ntype Dictionary<Type> = {\n [key: string]: Type;\n [index: number]: Type;\n};\n\nconst OWNER = '_owner';\n\nconst hasOwnProperty = Function.prototype.bind.call(\n Function.prototype.call,\n Object.prototype.hasOwnProperty,\n);\n\n/**\n * are the objects equal in value\n *\n * @param a the object to test\n * @param b the object to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta object to pass through\n * @returns are the objects equal\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator,\n meta: any,\n) {\n const keysA = keys(a);\n\n let index = keysA.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n if (index) {\n let key: string;\n\n while (index-- > 0) {\n key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = isReactElement(a);\n const reactElementB = isReactElement(b);\n\n if (\n (reactElementA || reactElementB) &&\n reactElementA !== reactElementB\n ) {\n return false;\n }\n }\n\n if (!hasOwnProperty(b, key) || !isEqual(a[key], b[key], key, key, a, b, meta)) {\n return false;\n }\n }\n }\n\n return true;\n}\n\n/**\n * are the regExps equal in value\n *\n * @param a the regExp to test\n * @param b the regExp to test agains\n * @returns are the regExps equal\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp) {\n return (\n a.source === b.source &&\n a.global === b.global &&\n a.ignoreCase === b.ignoreCase &&\n a.multiline === b.multiline &&\n a.unicode === b.unicode &&\n a.sticky === b.sticky &&\n a.lastIndex === b.lastIndex\n );\n}\n\n/**\n * are the sets equal in value\n *\n * @param a the set to test\n * @param b the set to test against\n * @param isEqual the comparator to determine equality\n * @param meta the meta set to pass through\n * @returns are the sets equal\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator,\n meta: any,\n) {\n let isValueEqual = a.size === b.size;\n\n if (isValueEqual && a.size) {\n const matchedIndices: Record<number, true> = {};\n\n a.forEach((aValue, aKey) => {\n if (isValueEqual) {\n let hasMatch = false;\n let matchIndex = 0;\n\n b.forEach((bValue, bKey) => {\n if (!hasMatch && !matchedIndices[matchIndex]) {\n hasMatch = isEqual(aValue, bValue, aKey, bKey, a, b, meta);\n\n if (hasMatch) {\n matchedIndices[matchIndex] = true;\n }\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n }\n });\n }\n\n return isValueEqual;\n}\n","import {\n EqualityComparator,\n InternalEqualityComparator,\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n isPlainObject,\n isPromiseLike,\n sameValueZeroEqual,\n} from './utils';\n\nconst HAS_MAP_SUPPORT = typeof Map === 'function';\nconst HAS_SET_SUPPORT = typeof Set === 'function';\n\nexport type EqualityComparatorCreator = (fn: EqualityComparator) => InternalEqualityComparator;\n\nexport function createComparator(createIsEqual?: EqualityComparatorCreator): EqualityComparator {\n const isEqual: InternalEqualityComparator =\n /* eslint-disable no-use-before-define */\n typeof createIsEqual === 'function'\n ? createIsEqual(comparator)\n : (a: any, b: any, indexOrKeyA: any, indexOrKeyB: any, parentA: any, parentB: any, meta: any) => comparator(a, b, meta);\n /* eslint-enable */\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n *\n * @param a the value to test against\n * @param b the value to test\n * @param [meta] an optional meta object that is passed through to all equality test calls\n * @returns are a and b equivalent in value\n */\n function comparator(a: any, b: any, meta?: any) {\n if (a === b) {\n return true;\n }\n\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n if (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n let aShape = Array.isArray(a);\n let bShape = Array.isArray(b);\n\n if (aShape || bShape) {\n return aShape === bShape && areArraysEqual(a, b, isEqual, meta);\n }\n\n aShape = a instanceof Date;\n bShape = b instanceof Date;\n\n if (aShape || bShape) {\n return (\n aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime())\n );\n }\n\n aShape = a instanceof RegExp;\n bShape = b instanceof RegExp;\n\n if (aShape || bShape) {\n return aShape === bShape && areRegExpsEqual(a, b);\n }\n\n if (isPromiseLike(a) || isPromiseLike(b)) {\n return a === b;\n }\n\n if (HAS_MAP_SUPPORT) {\n aShape = a instanceof Map;\n bShape = b instanceof Map;\n\n if (aShape || bShape) {\n return aShape === bShape && areMapsEqual(a, b, isEqual, meta);\n }\n }\n\n if (HAS_SET_SUPPORT) {\n aShape = a instanceof Set;\n bShape = b instanceof Set;\n\n if (aShape || bShape) {\n return aShape === bShape && areSetsEqual(a, b, isEqual, meta);\n }\n }\n\n return areObjectsEqual(a, b, isEqual, meta);\n }\n\n return a !== a && b !== b;\n }\n\n return comparator;\n}\n","import { createComparator } from './comparator';\nimport { createCircularEqualCreator, sameValueZeroEqual } from './utils';\n\nexport { createComparator as createCustomEqual, sameValueZeroEqual };\n\nexport const deepEqual = createComparator();\nexport const shallowEqual = createComparator(() => sameValueZeroEqual);\n\nexport const circularDeepEqual = createComparator(createCircularEqualCreator());\nexport const circularShallowEqual = createComparator(\n createCircularEqualCreator(sameValueZeroEqual),\n);\n"],"names":[],"mappings":";;;;AAAA,IAAM,mBAAmB,GAAG,OAAO,OAAO,KAAK,UAAU,CAAC;AAElD,IAAA,IAAI,GAAK,MAAM,KAAX,CAAY;AAuBxB;;;;;;;SAOgB,kBAAkB,CAAC,CAAM,EAAE,CAAM;IAC/C,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AACzC,CAAC;AAED;;;;;;SAMgB,aAAa,CAAC,KAAU;IACtC,OAAO,KAAK,CAAC,WAAW,KAAK,MAAM,IAAI,KAAK,CAAC,WAAW,IAAI,IAAI,CAAC;AACnE,CAAC;AAED;;;;;;SAMgB,aAAa,CAAC,KAAU;IACtC,OAAO,CAAC,CAAC,KAAK,IAAI,OAAO,KAAK,CAAC,IAAI,KAAK,UAAU,CAAC;AACrD,CAAC;AAED;;;;;;SAMgB,cAAc,CAAC,KAAU;IACvC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC,QAAQ,CAAC,CAAC;AACrC,CAAC;AAED;;;;;;SAMgB,mBAAmB;IACjC,IAAM,MAAM,GAAU,EAAE,CAAC;IAEzB,OAAO;QACL,GAAG,EAAH,UAAI,KAAU;YACZ,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;SACpB;QAED,GAAG,EAAH,UAAI,KAAU;YACZ,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;SACrC;KACF,CAAC;AACJ,CAAC;AAED;;;;;AAKO,IAAM,WAAW,GAAG,CAAC,UAAC,aAAsB;IACjD,IAAI,aAAa,EAAE;QACjB,OAAO,SAAS,YAAY;YAC1B,OAAO,IAAI,OAAO,EAAE,CAAC;SACtB,CAAC;KACH;IAED,OAAO,mBAAmB,CAAC;AAC7B,CA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