fast-equals 5.3.3 → 5.3.4
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/LICENSE +1 -1
- package/README.md +127 -76
- package/dist/cjs/comparator.d.cts +58 -0
- package/dist/cjs/index.cjs +132 -155
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/{types/index.d.cts → index.d.cts} +21 -2
- package/{src/internalTypes.ts → dist/cjs/internalTypes.d.cts} +7 -43
- package/dist/cjs/{types/utils.d.cts → utils.d.cts} +7 -2
- package/dist/es/comparator.d.mts +58 -0
- package/dist/{esm/types → es}/index.d.mts +21 -2
- package/dist/{esm → es}/index.mjs +132 -155
- package/dist/es/index.mjs.map +1 -0
- package/dist/es/internalTypes.d.mts +174 -0
- package/dist/{esm/types → es}/utils.d.mts +7 -2
- package/dist/{min/types → umd}/comparator.d.ts +1 -1
- package/dist/umd/index.js +132 -155
- package/dist/umd/index.js.map +1 -1
- package/index.d.ts +62 -68
- package/package.json +44 -47
- package/CHANGELOG.md +0 -364
- package/dist/cjs/types/comparator.d.cts +0 -26
- package/dist/cjs/types/internalTypes.d.cts +0 -157
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/types/comparator.d.mts +0 -26
- package/dist/esm/types/internalTypes.d.mts +0 -157
- package/dist/min/index.js +0 -1
- package/dist/umd/types/comparator.d.ts +0 -26
- package/dist/umd/types/equals.d.ts +0 -54
- package/dist/umd/types/index.d.ts +0 -47
- package/dist/umd/types/internalTypes.d.ts +0 -157
- package/dist/umd/types/utils.d.ts +0 -28
- package/src/comparator.ts +0 -376
- package/src/equals.ts +0 -355
- package/src/index.ts +0 -112
- package/src/utils.ts +0 -96
- /package/dist/cjs/{types/equals.d.cts → equals.d.cts} +0 -0
- /package/dist/{esm/types → es}/equals.d.mts +0 -0
- /package/dist/{min/types → umd}/equals.d.ts +0 -0
- /package/dist/{min/types → umd}/index.d.ts +0 -0
- /package/dist/{min/types → umd}/internalTypes.d.ts +0 -0
- /package/dist/{min/types → umd}/utils.d.ts +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const { getOwnPropertyNames, getOwnPropertySymbols } = Object;
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
3
|
+
const { hasOwnProperty } = Object.prototype;
|
|
3
4
|
/**
|
|
4
5
|
* Combine two comparators into a single comparators.
|
|
5
6
|
*/
|
|
@@ -18,15 +19,15 @@ function createIsCircular(areItemsEqual) {
|
|
|
18
19
|
if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
|
|
19
20
|
return areItemsEqual(a, b, state);
|
|
20
21
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
const { cache } = state;
|
|
23
|
+
const cachedA = cache.get(a);
|
|
24
|
+
const cachedB = cache.get(b);
|
|
24
25
|
if (cachedA && cachedB) {
|
|
25
26
|
return cachedA === b && cachedB === a;
|
|
26
27
|
}
|
|
27
28
|
cache.set(a, b);
|
|
28
29
|
cache.set(b, a);
|
|
29
|
-
|
|
30
|
+
const result = areItemsEqual(a, b, state);
|
|
30
31
|
cache.delete(a);
|
|
31
32
|
cache.delete(b);
|
|
32
33
|
return result;
|
|
@@ -48,12 +49,9 @@ function getStrictProperties(object) {
|
|
|
48
49
|
/**
|
|
49
50
|
* Whether the object contains the property passed as an own property.
|
|
50
51
|
*/
|
|
51
|
-
|
|
52
|
+
const hasOwn =
|
|
52
53
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
53
|
-
Object.hasOwn ||
|
|
54
|
-
(function (object, property) {
|
|
55
|
-
return hasOwnProperty.call(object, property);
|
|
56
|
-
});
|
|
54
|
+
Object.hasOwn || ((object, property) => hasOwnProperty.call(object, property));
|
|
57
55
|
/**
|
|
58
56
|
* Whether the values passed are strictly equal or both NaN.
|
|
59
57
|
*/
|
|
@@ -61,15 +59,15 @@ function sameValueZeroEqual(a, b) {
|
|
|
61
59
|
return a === b || (!a && !b && a !== a && b !== b);
|
|
62
60
|
}
|
|
63
61
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
const PREACT_VNODE = '__v';
|
|
63
|
+
const PREACT_OWNER = '__o';
|
|
64
|
+
const REACT_OWNER = '_owner';
|
|
65
|
+
const { getOwnPropertyDescriptor, keys } = Object;
|
|
68
66
|
/**
|
|
69
67
|
* Whether the arrays are equal in value.
|
|
70
68
|
*/
|
|
71
69
|
function areArraysEqual(a, b, state) {
|
|
72
|
-
|
|
70
|
+
let index = a.length;
|
|
73
71
|
if (b.length !== index) {
|
|
74
72
|
return false;
|
|
75
73
|
}
|
|
@@ -90,10 +88,7 @@ function areDatesEqual(a, b) {
|
|
|
90
88
|
* Whether the errors passed are equal in value.
|
|
91
89
|
*/
|
|
92
90
|
function areErrorsEqual(a, b) {
|
|
93
|
-
return
|
|
94
|
-
a.message === b.message &&
|
|
95
|
-
a.cause === b.cause &&
|
|
96
|
-
a.stack === b.stack);
|
|
91
|
+
return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;
|
|
97
92
|
}
|
|
98
93
|
/**
|
|
99
94
|
* Whether the functions passed are equal in value.
|
|
@@ -105,26 +100,26 @@ function areFunctionsEqual(a, b) {
|
|
|
105
100
|
* Whether the `Map`s are equal in value.
|
|
106
101
|
*/
|
|
107
102
|
function areMapsEqual(a, b, state) {
|
|
108
|
-
|
|
103
|
+
const size = a.size;
|
|
109
104
|
if (size !== b.size) {
|
|
110
105
|
return false;
|
|
111
106
|
}
|
|
112
107
|
if (!size) {
|
|
113
108
|
return true;
|
|
114
109
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
110
|
+
const matchedIndices = new Array(size);
|
|
111
|
+
const aIterable = a.entries();
|
|
112
|
+
let aResult;
|
|
113
|
+
let bResult;
|
|
114
|
+
let index = 0;
|
|
120
115
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
121
116
|
while ((aResult = aIterable.next())) {
|
|
122
117
|
if (aResult.done) {
|
|
123
118
|
break;
|
|
124
119
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
120
|
+
const bIterable = b.entries();
|
|
121
|
+
let hasMatch = false;
|
|
122
|
+
let matchIndex = 0;
|
|
128
123
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
129
124
|
while ((bResult = bIterable.next())) {
|
|
130
125
|
if (bResult.done) {
|
|
@@ -134,10 +129,10 @@ function areMapsEqual(a, b, state) {
|
|
|
134
129
|
matchIndex++;
|
|
135
130
|
continue;
|
|
136
131
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
|
|
140
|
-
state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
132
|
+
const aEntry = aResult.value;
|
|
133
|
+
const bEntry = bResult.value;
|
|
134
|
+
if (state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)
|
|
135
|
+
&& state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)) {
|
|
141
136
|
hasMatch = matchedIndices[matchIndex] = true;
|
|
142
137
|
break;
|
|
143
138
|
}
|
|
@@ -153,13 +148,13 @@ function areMapsEqual(a, b, state) {
|
|
|
153
148
|
/**
|
|
154
149
|
* Whether the numbers are equal in value.
|
|
155
150
|
*/
|
|
156
|
-
|
|
151
|
+
const areNumbersEqual = sameValueZeroEqual;
|
|
157
152
|
/**
|
|
158
153
|
* Whether the objects are equal in value.
|
|
159
154
|
*/
|
|
160
155
|
function areObjectsEqual(a, b, state) {
|
|
161
|
-
|
|
162
|
-
|
|
156
|
+
const properties = keys(a);
|
|
157
|
+
let index = properties.length;
|
|
163
158
|
if (keys(b).length !== index) {
|
|
164
159
|
return false;
|
|
165
160
|
}
|
|
@@ -178,14 +173,14 @@ function areObjectsEqual(a, b, state) {
|
|
|
178
173
|
* Whether the objects are equal in value with strict property checking.
|
|
179
174
|
*/
|
|
180
175
|
function areObjectsEqualStrict(a, b, state) {
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
const properties = getStrictProperties(a);
|
|
177
|
+
let index = properties.length;
|
|
183
178
|
if (getStrictProperties(b).length !== index) {
|
|
184
179
|
return false;
|
|
185
180
|
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
181
|
+
let property;
|
|
182
|
+
let descriptorA;
|
|
183
|
+
let descriptorB;
|
|
189
184
|
// Decrementing `while` showed faster results than either incrementing or
|
|
190
185
|
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
191
186
|
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
@@ -197,12 +192,12 @@ function areObjectsEqualStrict(a, b, state) {
|
|
|
197
192
|
}
|
|
198
193
|
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
199
194
|
descriptorB = getOwnPropertyDescriptor(b, property);
|
|
200
|
-
if ((descriptorA || descriptorB)
|
|
201
|
-
(!descriptorA
|
|
202
|
-
!descriptorB
|
|
203
|
-
descriptorA.configurable !== descriptorB.configurable
|
|
204
|
-
descriptorA.enumerable !== descriptorB.enumerable
|
|
205
|
-
descriptorA.writable !== descriptorB.writable)) {
|
|
195
|
+
if ((descriptorA || descriptorB)
|
|
196
|
+
&& (!descriptorA
|
|
197
|
+
|| !descriptorB
|
|
198
|
+
|| descriptorA.configurable !== descriptorB.configurable
|
|
199
|
+
|| descriptorA.enumerable !== descriptorB.enumerable
|
|
200
|
+
|| descriptorA.writable !== descriptorB.writable)) {
|
|
206
201
|
return false;
|
|
207
202
|
}
|
|
208
203
|
}
|
|
@@ -224,32 +219,32 @@ function areRegExpsEqual(a, b) {
|
|
|
224
219
|
* Whether the `Set`s are equal in value.
|
|
225
220
|
*/
|
|
226
221
|
function areSetsEqual(a, b, state) {
|
|
227
|
-
|
|
222
|
+
const size = a.size;
|
|
228
223
|
if (size !== b.size) {
|
|
229
224
|
return false;
|
|
230
225
|
}
|
|
231
226
|
if (!size) {
|
|
232
227
|
return true;
|
|
233
228
|
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
229
|
+
const matchedIndices = new Array(size);
|
|
230
|
+
const aIterable = a.values();
|
|
231
|
+
let aResult;
|
|
232
|
+
let bResult;
|
|
238
233
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
239
234
|
while ((aResult = aIterable.next())) {
|
|
240
235
|
if (aResult.done) {
|
|
241
236
|
break;
|
|
242
237
|
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
238
|
+
const bIterable = b.values();
|
|
239
|
+
let hasMatch = false;
|
|
240
|
+
let matchIndex = 0;
|
|
246
241
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
247
242
|
while ((bResult = bIterable.next())) {
|
|
248
243
|
if (bResult.done) {
|
|
249
244
|
break;
|
|
250
245
|
}
|
|
251
|
-
if (!matchedIndices[matchIndex]
|
|
252
|
-
state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
246
|
+
if (!matchedIndices[matchIndex]
|
|
247
|
+
&& state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)) {
|
|
253
248
|
hasMatch = matchedIndices[matchIndex] = true;
|
|
254
249
|
break;
|
|
255
250
|
}
|
|
@@ -265,7 +260,7 @@ function areSetsEqual(a, b, state) {
|
|
|
265
260
|
* Whether the TypedArray instances are equal in value.
|
|
266
261
|
*/
|
|
267
262
|
function areTypedArraysEqual(a, b) {
|
|
268
|
-
|
|
263
|
+
let index = a.length;
|
|
269
264
|
if (b.length !== index) {
|
|
270
265
|
return false;
|
|
271
266
|
}
|
|
@@ -280,47 +275,44 @@ function areTypedArraysEqual(a, b) {
|
|
|
280
275
|
* Whether the URL instances are equal in value.
|
|
281
276
|
*/
|
|
282
277
|
function areUrlsEqual(a, b) {
|
|
283
|
-
return (a.hostname === b.hostname
|
|
284
|
-
a.pathname === b.pathname
|
|
285
|
-
a.protocol === b.protocol
|
|
286
|
-
a.port === b.port
|
|
287
|
-
a.hash === b.hash
|
|
288
|
-
a.username === b.username
|
|
289
|
-
a.password === b.password);
|
|
278
|
+
return (a.hostname === b.hostname
|
|
279
|
+
&& a.pathname === b.pathname
|
|
280
|
+
&& a.protocol === b.protocol
|
|
281
|
+
&& a.port === b.port
|
|
282
|
+
&& a.hash === b.hash
|
|
283
|
+
&& a.username === b.username
|
|
284
|
+
&& a.password === b.password);
|
|
290
285
|
}
|
|
291
286
|
function isPropertyEqual(a, b, state, property) {
|
|
292
|
-
if ((property === REACT_OWNER ||
|
|
293
|
-
|
|
294
|
-
property === PREACT_VNODE) &&
|
|
295
|
-
(a.$$typeof || b.$$typeof)) {
|
|
287
|
+
if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
|
|
288
|
+
&& (a.$$typeof || b.$$typeof)) {
|
|
296
289
|
return true;
|
|
297
290
|
}
|
|
298
|
-
return
|
|
299
|
-
state.equals(a[property], b[property], property, property, a, b, state));
|
|
291
|
+
return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
|
|
300
292
|
}
|
|
301
293
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
294
|
+
const ARGUMENTS_TAG = '[object Arguments]';
|
|
295
|
+
const BOOLEAN_TAG = '[object Boolean]';
|
|
296
|
+
const DATE_TAG = '[object Date]';
|
|
297
|
+
const ERROR_TAG = '[object Error]';
|
|
298
|
+
const MAP_TAG = '[object Map]';
|
|
299
|
+
const NUMBER_TAG = '[object Number]';
|
|
300
|
+
const OBJECT_TAG = '[object Object]';
|
|
301
|
+
const REG_EXP_TAG = '[object RegExp]';
|
|
302
|
+
const SET_TAG = '[object Set]';
|
|
303
|
+
const STRING_TAG = '[object String]';
|
|
304
|
+
const URL_TAG = '[object URL]';
|
|
305
|
+
const { isArray } = Array;
|
|
306
|
+
const isTypedArray =
|
|
307
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
308
|
+
typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView : null;
|
|
309
|
+
const { assign } = Object;
|
|
310
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
311
|
+
const getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
|
|
319
312
|
/**
|
|
320
313
|
* Create a comparator method based on the type-specific equality comparators passed.
|
|
321
314
|
*/
|
|
322
|
-
function createEqualityComparator(
|
|
323
|
-
var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areErrorsEqual = _a.areErrorsEqual, areFunctionsEqual = _a.areFunctionsEqual, areMapsEqual = _a.areMapsEqual, areNumbersEqual = _a.areNumbersEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual, areUrlsEqual = _a.areUrlsEqual, unknownTagComparators = _a.unknownTagComparators;
|
|
315
|
+
function createEqualityComparator({ areArraysEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }) {
|
|
324
316
|
/**
|
|
325
317
|
* compare the value of the two objects and return true if they are equivalent in values
|
|
326
318
|
*/
|
|
@@ -334,7 +326,7 @@ function createEqualityComparator(_a) {
|
|
|
334
326
|
if (a == null || b == null) {
|
|
335
327
|
return false;
|
|
336
328
|
}
|
|
337
|
-
|
|
329
|
+
const type = typeof a;
|
|
338
330
|
if (type !== typeof b) {
|
|
339
331
|
return false;
|
|
340
332
|
}
|
|
@@ -348,7 +340,7 @@ function createEqualityComparator(_a) {
|
|
|
348
340
|
// If a primitive value that is not strictly equal, it must be unequal.
|
|
349
341
|
return false;
|
|
350
342
|
}
|
|
351
|
-
|
|
343
|
+
const constructor = a.constructor;
|
|
352
344
|
// Checks are listed in order of commonality of use-case:
|
|
353
345
|
// 1. Common complex object types (plain object, array)
|
|
354
346
|
// 2. Common data values (date, regexp)
|
|
@@ -397,7 +389,7 @@ function createEqualityComparator(_a) {
|
|
|
397
389
|
}
|
|
398
390
|
// Since this is a custom object, capture the string tag to determing its type.
|
|
399
391
|
// This is reasonably performant in modern environments like v8 and SpiderMonkey.
|
|
400
|
-
|
|
392
|
+
const tag = getTag(a);
|
|
401
393
|
if (tag === DATE_TAG) {
|
|
402
394
|
return areDatesEqual(a, b, state);
|
|
403
395
|
}
|
|
@@ -416,9 +408,7 @@ function createEqualityComparator(_a) {
|
|
|
416
408
|
// The exception for value comparison is custom `Promise`-like class instances. These should
|
|
417
409
|
// be treated the same as standard `Promise` objects, which means strict equality, and if
|
|
418
410
|
// it reaches this point then that strict equality comparison has already failed.
|
|
419
|
-
return
|
|
420
|
-
typeof b.then !== 'function' &&
|
|
421
|
-
areObjectsEqual(a, b, state));
|
|
411
|
+
return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);
|
|
422
412
|
}
|
|
423
413
|
// If a URL tag, it should be tested explicitly. Like RegExp, the properties are not
|
|
424
414
|
// enumerable, and therefore will give false positives if tested like a standard object.
|
|
@@ -441,9 +431,9 @@ function createEqualityComparator(_a) {
|
|
|
441
431
|
return arePrimitiveWrappersEqual(a, b, state);
|
|
442
432
|
}
|
|
443
433
|
if (unknownTagComparators) {
|
|
444
|
-
|
|
434
|
+
let unknownTagComparator = unknownTagComparators[tag];
|
|
445
435
|
if (!unknownTagComparator) {
|
|
446
|
-
|
|
436
|
+
const shortTag = getShortTag(a);
|
|
447
437
|
if (shortTag) {
|
|
448
438
|
unknownTagComparator = unknownTagComparators[shortTag];
|
|
449
439
|
}
|
|
@@ -471,30 +461,19 @@ function createEqualityComparator(_a) {
|
|
|
471
461
|
/**
|
|
472
462
|
* Create the configuration object used for building comparators.
|
|
473
463
|
*/
|
|
474
|
-
function createEqualityComparatorConfig(
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
areArraysEqual: strict
|
|
478
|
-
? areObjectsEqualStrict
|
|
479
|
-
: areArraysEqual,
|
|
464
|
+
function createEqualityComparatorConfig({ circular, createCustomConfig, strict, }) {
|
|
465
|
+
let config = {
|
|
466
|
+
areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
|
|
480
467
|
areDatesEqual: areDatesEqual,
|
|
481
468
|
areErrorsEqual: areErrorsEqual,
|
|
482
469
|
areFunctionsEqual: areFunctionsEqual,
|
|
483
|
-
areMapsEqual: strict
|
|
484
|
-
? combineComparators(areMapsEqual, areObjectsEqualStrict)
|
|
485
|
-
: areMapsEqual,
|
|
470
|
+
areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
|
|
486
471
|
areNumbersEqual: areNumbersEqual,
|
|
487
|
-
areObjectsEqual: strict
|
|
488
|
-
? areObjectsEqualStrict
|
|
489
|
-
: areObjectsEqual,
|
|
472
|
+
areObjectsEqual: strict ? areObjectsEqualStrict : areObjectsEqual,
|
|
490
473
|
arePrimitiveWrappersEqual: arePrimitiveWrappersEqual,
|
|
491
474
|
areRegExpsEqual: areRegExpsEqual,
|
|
492
|
-
areSetsEqual: strict
|
|
493
|
-
|
|
494
|
-
: areSetsEqual,
|
|
495
|
-
areTypedArraysEqual: strict
|
|
496
|
-
? areObjectsEqualStrict
|
|
497
|
-
: areTypedArraysEqual,
|
|
475
|
+
areSetsEqual: strict ? combineComparators(areSetsEqual, areObjectsEqualStrict) : areSetsEqual,
|
|
476
|
+
areTypedArraysEqual: strict ? areObjectsEqualStrict : areTypedArraysEqual,
|
|
498
477
|
areUrlsEqual: areUrlsEqual,
|
|
499
478
|
unknownTagComparators: undefined,
|
|
500
479
|
};
|
|
@@ -502,15 +481,15 @@ function createEqualityComparatorConfig(_a) {
|
|
|
502
481
|
config = assign({}, config, createCustomConfig(config));
|
|
503
482
|
}
|
|
504
483
|
if (circular) {
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
484
|
+
const areArraysEqual = createIsCircular(config.areArraysEqual);
|
|
485
|
+
const areMapsEqual = createIsCircular(config.areMapsEqual);
|
|
486
|
+
const areObjectsEqual = createIsCircular(config.areObjectsEqual);
|
|
487
|
+
const areSetsEqual = createIsCircular(config.areSetsEqual);
|
|
509
488
|
config = assign({}, config, {
|
|
510
|
-
areArraysEqual
|
|
511
|
-
areMapsEqual
|
|
512
|
-
areObjectsEqual
|
|
513
|
-
areSetsEqual
|
|
489
|
+
areArraysEqual,
|
|
490
|
+
areMapsEqual,
|
|
491
|
+
areObjectsEqual,
|
|
492
|
+
areSetsEqual,
|
|
514
493
|
});
|
|
515
494
|
}
|
|
516
495
|
return config;
|
|
@@ -527,16 +506,15 @@ function createInternalEqualityComparator(compare) {
|
|
|
527
506
|
/**
|
|
528
507
|
* Create the `isEqual` function used by the consuming application.
|
|
529
508
|
*/
|
|
530
|
-
function createIsEqual(
|
|
531
|
-
var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
|
|
509
|
+
function createIsEqual({ circular, comparator, createState, equals, strict }) {
|
|
532
510
|
if (createState) {
|
|
533
511
|
return function isEqual(a, b) {
|
|
534
|
-
|
|
512
|
+
const { cache = circular ? new WeakMap() : undefined, meta } = createState();
|
|
535
513
|
return comparator(a, b, {
|
|
536
|
-
cache
|
|
537
|
-
equals
|
|
538
|
-
meta
|
|
539
|
-
strict
|
|
514
|
+
cache,
|
|
515
|
+
equals,
|
|
516
|
+
meta,
|
|
517
|
+
strict,
|
|
540
518
|
});
|
|
541
519
|
};
|
|
542
520
|
}
|
|
@@ -544,17 +522,17 @@ function createIsEqual(_a) {
|
|
|
544
522
|
return function isEqual(a, b) {
|
|
545
523
|
return comparator(a, b, {
|
|
546
524
|
cache: new WeakMap(),
|
|
547
|
-
equals
|
|
525
|
+
equals,
|
|
548
526
|
meta: undefined,
|
|
549
|
-
strict
|
|
527
|
+
strict,
|
|
550
528
|
});
|
|
551
529
|
};
|
|
552
530
|
}
|
|
553
|
-
|
|
531
|
+
const state = {
|
|
554
532
|
cache: undefined,
|
|
555
|
-
equals
|
|
533
|
+
equals,
|
|
556
534
|
meta: undefined,
|
|
557
|
-
strict
|
|
535
|
+
strict,
|
|
558
536
|
};
|
|
559
537
|
return function isEqual(a, b) {
|
|
560
538
|
return comparator(a, b, state);
|
|
@@ -564,50 +542,50 @@ function createIsEqual(_a) {
|
|
|
564
542
|
/**
|
|
565
543
|
* Whether the items passed are deeply-equal in value.
|
|
566
544
|
*/
|
|
567
|
-
|
|
545
|
+
const deepEqual = createCustomEqual();
|
|
568
546
|
/**
|
|
569
547
|
* Whether the items passed are deeply-equal in value based on strict comparison.
|
|
570
548
|
*/
|
|
571
|
-
|
|
549
|
+
const strictDeepEqual = createCustomEqual({ strict: true });
|
|
572
550
|
/**
|
|
573
551
|
* Whether the items passed are deeply-equal in value, including circular references.
|
|
574
552
|
*/
|
|
575
|
-
|
|
553
|
+
const circularDeepEqual = createCustomEqual({ circular: true });
|
|
576
554
|
/**
|
|
577
555
|
* Whether the items passed are deeply-equal in value, including circular references,
|
|
578
556
|
* based on strict comparison.
|
|
579
557
|
*/
|
|
580
|
-
|
|
558
|
+
const strictCircularDeepEqual = createCustomEqual({
|
|
581
559
|
circular: true,
|
|
582
560
|
strict: true,
|
|
583
561
|
});
|
|
584
562
|
/**
|
|
585
563
|
* Whether the items passed are shallowly-equal in value.
|
|
586
564
|
*/
|
|
587
|
-
|
|
588
|
-
createInternalComparator:
|
|
565
|
+
const shallowEqual = createCustomEqual({
|
|
566
|
+
createInternalComparator: () => sameValueZeroEqual,
|
|
589
567
|
});
|
|
590
568
|
/**
|
|
591
569
|
* Whether the items passed are shallowly-equal in value based on strict comparison
|
|
592
570
|
*/
|
|
593
|
-
|
|
571
|
+
const strictShallowEqual = createCustomEqual({
|
|
594
572
|
strict: true,
|
|
595
|
-
createInternalComparator:
|
|
573
|
+
createInternalComparator: () => sameValueZeroEqual,
|
|
596
574
|
});
|
|
597
575
|
/**
|
|
598
576
|
* Whether the items passed are shallowly-equal in value, including circular references.
|
|
599
577
|
*/
|
|
600
|
-
|
|
578
|
+
const circularShallowEqual = createCustomEqual({
|
|
601
579
|
circular: true,
|
|
602
|
-
createInternalComparator:
|
|
580
|
+
createInternalComparator: () => sameValueZeroEqual,
|
|
603
581
|
});
|
|
604
582
|
/**
|
|
605
583
|
* Whether the items passed are shallowly-equal in value, including circular references,
|
|
606
584
|
* based on strict comparison.
|
|
607
585
|
*/
|
|
608
|
-
|
|
586
|
+
const strictCircularShallowEqual = createCustomEqual({
|
|
609
587
|
circular: true,
|
|
610
|
-
createInternalComparator:
|
|
588
|
+
createInternalComparator: () => sameValueZeroEqual,
|
|
611
589
|
strict: true,
|
|
612
590
|
});
|
|
613
591
|
/**
|
|
@@ -618,15 +596,14 @@ var strictCircularShallowEqual = createCustomEqual({
|
|
|
618
596
|
* support for legacy environments that do not support expected features like
|
|
619
597
|
* `RegExp.prototype.flags` out of the box.
|
|
620
598
|
*/
|
|
621
|
-
function createCustomEqual(options) {
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
var equals = createCustomInternalComparator
|
|
599
|
+
function createCustomEqual(options = {}) {
|
|
600
|
+
const { circular = false, createInternalComparator: createCustomInternalComparator, createState, strict = false, } = options;
|
|
601
|
+
const config = createEqualityComparatorConfig(options);
|
|
602
|
+
const comparator = createEqualityComparator(config);
|
|
603
|
+
const equals = createCustomInternalComparator
|
|
627
604
|
? createCustomInternalComparator(comparator)
|
|
628
605
|
: createInternalEqualityComparator(comparator);
|
|
629
|
-
return createIsEqual({ circular
|
|
606
|
+
return createIsEqual({ circular, comparator, createState, equals, strict });
|
|
630
607
|
}
|
|
631
608
|
|
|
632
609
|
export { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/utils.ts","../../../src/equals.ts","../../../src/comparator.ts","../../../src/index.ts"],"sourcesContent":["import type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes.js';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<AreItemsEqual extends TypeEqualityComparator<any, any>>(\n areItemsEqual: AreItemsEqual,\n): AreItemsEqual {\n return function isCircular(a: any, b: any, state: CircularState<Cache<any, any>>) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nexport function getShortTag(value: any): string | undefined {\n return value != null ? (value[Symbol.toStringTag] as string) : undefined;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(object: Dictionary): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(getOwnPropertySymbols(object));\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.hasOwn || ((object: Dictionary, property: number | string | symbol) => hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';\nimport { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils.js';\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index]!)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password\n );\n}\n\nfunction isPropertyEqual(a: Dictionary, b: Dictionary, state: State<any>, property: string | symbol) {\n if (\n (property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)\n ) {\n return true;\n }\n\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals.js';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes.js';\nimport { combineComparators, createIsCircular, getShortTag } from './utils.js';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst URL_TAG = '[object URL]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n // eslint-disable-next-line @typescript-eslint/unbound-method\n typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView : null;\nconst { assign } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst getTag = Object.prototype.toString.call.bind(Object.prototype.toString) as (a: object) => string;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n unknownTagComparators,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a as object);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault) : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict ? areObjectsEqualStrictDefault : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault) : areSetsEqualDefault,\n areTypedArraysEqual: strict ? areObjectsEqualStrictDefault : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({ circular, comparator, createState, equals, strict }: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator.js';\nimport type { CustomEqualCreatorOptions } from './internalTypes.js';\nimport { sameValueZeroEqual } from './utils.js';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes.js';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(options: CustomEqualCreatorOptions<Meta> = {}) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault"],"mappings":"AASA,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,MAAM;AAC7D;AACA,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS;AAE3C;;AAEG;A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