fast-equals 5.4.4 → 5.4.6

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/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
  <img src="https://img.shields.io/badge/license-MIT-blue.svg"/>
6
6
 
7
7
  Perform [blazing fast](#benchmarks) equality comparisons (either deep or shallow) on two objects passed, while also
8
- maintaining a high degree of flexibility for various implementation use-cases. It has no dependencies, and is ~2.3kB
8
+ maintaining a high degree of flexibility for various implementation use-cases. It has no dependencies, and is ~2.51kB
9
9
  when minified and gzipped.
10
10
 
11
11
  The following types are handled out-of-the-box:
@@ -35,6 +35,7 @@ customize any specific type comparison based on your application's use-cases.
35
35
  - [Available methods](#available-methods)
36
36
  - [deepEqual](#deepequal)
37
37
  - [Comparing `Map`s](#comparing-maps)
38
+ - [Comparing `URL`s](#comparing-urls)
38
39
  - [shallowEqual](#shallowequal)
39
40
  - [sameValueZeroEqual](#samevaluezeroequal)
40
41
  - [circularDeepEqual](#circulardeepequal)
@@ -103,6 +104,17 @@ deepEqual(mapA, mapB);
103
104
  To support true deep equality of all contents, `fast-equals` will perform a deep equality comparison for key and value
104
105
  parirs. Therefore, the above would be `true`.
105
106
 
107
+ #### Comparing `URL`s
108
+
109
+ `URL` objects are equal when their `href` matches, as in the
110
+ [URL Standard](https://url.spec.whatwg.org/#url-equivalence), except that query pair order is not significant (repeated
111
+ keys are counted). Everything else is compared as written:
112
+
113
+ ```ts
114
+ deepEqual(new URL('https://foo.com/?a=1&b=2'), new URL('https://foo.com/?b=2&a=1')); // true
115
+ deepEqual(new URL('https://foo.com/?a=%41'), new URL('https://foo.com/?a=A')); // false
116
+ ```
117
+
106
118
  ### shallowEqual
107
119
 
108
120
  Performs a shallow equality comparison on the two objects passed and returns a boolean representing the value
@@ -64,7 +64,14 @@ function sameValueZeroEqual(a, b) {
64
64
  const PREACT_VNODE = '__v';
65
65
  const PREACT_OWNER = '__o';
66
66
  const REACT_OWNER = '_owner';
67
+ /**
68
+ * Above this many keys, out-of-position keys are checked with `propertyIsEnumerable` rather than by
69
+ * scanning the other object's keys. Measured in V8: scanning wins up to 50 keys and loses from 100.
70
+ */
71
+ const MAX_SCANNED_PROPERTIES = 64;
67
72
  const { getOwnPropertyDescriptor, keys } = Object;
73
+ // eslint-disable-next-line @typescript-eslint/unbound-method
74
+ const { propertyIsEnumerable } = Object.prototype;
68
75
  /**
69
76
  * Identify the element type of TypedArrays across realms and subclasses.
70
77
  */
@@ -106,12 +113,60 @@ function areDatesEqual(a, b) {
106
113
  }
107
114
  /**
108
115
  * Whether the errors passed are equal in value.
116
+ *
117
+ * @note
118
+ * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared
119
+ * explicitly. `cause` and `errors` are compared by value rather than by reference, matching how
120
+ * every other nested value in the comparison is treated. They are compared exactly once, regardless
121
+ * of whether they were assigned (enumerable) or set by the constructor (non-enumerable). Other own
122
+ * enumerable properties (which custom `Error` subclasses commonly add) are compared afterward.
123
+ *
124
+ * The own property comparison is inlined rather than extracted, which measured faster in V8 when
125
+ * recursing through `cause`. Keep the bytecode under V8's 460-byte TurboFan inlining limit (383 bytes
126
+ * at time of writing; check with `node --print-bytecode --print-bytecode-filter=areErrorsEqual`), or
127
+ * this stops being inlined into its callers.
109
128
  */
110
129
  function areErrorsEqual(a, b, state) {
111
- return (a.name === b.name
112
- && a.message === b.message
113
- && a.stack === b.stack
114
- && state.equals(a.cause, b.cause, 'cause', 'cause', a, b, state));
130
+ if (a.name !== b.name || a.message !== b.message || a.stack !== b.stack) {
131
+ return false;
132
+ }
133
+ const causeA = a.cause;
134
+ const causeB = b.cause;
135
+ if (causeA !== causeB && !state.equals(causeA, causeB, 'cause', 'cause', a, b, state)) {
136
+ return false;
137
+ }
138
+ const errorsA = a.errors;
139
+ const errorsB = b.errors;
140
+ if (errorsA !== errorsB && !state.equals(errorsA, errorsB, 'errors', 'errors', a, b, state)) {
141
+ return false;
142
+ }
143
+ const propertiesA = keys(a);
144
+ const propertiesB = keys(b);
145
+ let index = propertiesA.length;
146
+ // Constructed errors rarely have enumerable own properties.
147
+ if (!index && !propertiesB.length) {
148
+ return true;
149
+ }
150
+ let compared = 0;
151
+ let property;
152
+ while (index-- > 0) {
153
+ property = propertiesA[index];
154
+ // Already compared above regardless of enumerability, so we can ignore them.
155
+ if (property === 'cause' || property === 'errors') {
156
+ continue;
157
+ }
158
+ // `propertyIsEnumerable` rather than `hasOwn`, so that a non-enumerable own property on `b` cannot
159
+ // stand in for an enumerable one. Keys in the same position are trivially enumerable on `b`.
160
+ if ((property !== propertiesB[index] && !propertyIsEnumerable.call(b, property))
161
+ || !state.equals(a[property], b[property], property, property, a, b, state)) {
162
+ return false;
163
+ }
164
+ ++compared;
165
+ }
166
+ // Every compared key is enumerable on `b`, so any of `b`'s keys left over must be `cause` / `errors`.
167
+ const remaining = propertiesB.length - compared;
168
+ return (!remaining
169
+ || remaining === (propertyIsEnumerable.call(b, 'cause') ? 1 : 0) + (propertyIsEnumerable.call(b, 'errors') ? 1 : 0));
115
170
  }
116
171
  /**
117
172
  * Whether the functions passed are equal in value.
@@ -119,6 +174,17 @@ function areErrorsEqual(a, b, state) {
119
174
  function areFunctionsEqual(a, b) {
120
175
  return a === b;
121
176
  }
177
+ /**
178
+ * Whether the errors passed are equal in value.
179
+ *
180
+ * @note
181
+ * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared
182
+ * explicitly. `cause` and `errors` are own properties, so `areObjectsEqualStrict` compares them along
183
+ * with every other own property; they are not compared explicitly to avoid comparing them twice.
184
+ */
185
+ function areErrorsEqualStrict(a, b, state) {
186
+ return a.name === b.name && a.message === b.message && a.stack === b.stack && areObjectsEqualStrict(a, b, state);
187
+ }
122
188
  /**
123
189
  * Whether the `Map`s are equal in value.
124
190
  */
@@ -177,16 +243,30 @@ const areNumbersEqual = sameValueZeroEqual;
177
243
  */
178
244
  function areObjectsEqual(a, b, state) {
179
245
  const properties = keys(a);
246
+ const propertiesB = keys(b);
180
247
  let index = properties.length;
181
- if (keys(b).length !== index) {
248
+ if (propertiesB.length !== index) {
182
249
  return false;
183
250
  }
251
+ const isScannable = index <= MAX_SCANNED_PROPERTIES;
252
+ let property;
184
253
  // Decrementing `while` showed faster results than either incrementing or
185
254
  // decrementing `for` loop and than an incrementing `while` loop. Declarative
186
255
  // methods like `some` / `every` were not used to avoid incurring the garbage
187
256
  // cost of anonymous callbacks.
188
257
  while (index-- > 0) {
189
- if (!isPropertyEqual(a, b, state, properties[index])) {
258
+ property = properties[index];
259
+ if (isReactProperty(a, b, property)) {
260
+ continue;
261
+ }
262
+ // Objects built the same way list their keys in the same order, in which case the key is
263
+ // already known to be an own enumerable property of `b` and the lookup can be skipped.
264
+ // Otherwise, `propertiesB` is exactly `b`'s own enumerable keys. Scanning it is faster than
265
+ // `propertyIsEnumerable` for smaller objects, but it is linear per key, so larger objects
266
+ // (where reordering would make it quadratic) use the lookup instead.
267
+ if ((property !== propertiesB[index]
268
+ && !(isScannable ? propertiesB.includes(property) : propertyIsEnumerable.call(b, property)))
269
+ || !state.equals(a[property], b[property], property, property, a, b, state)) {
190
270
  return false;
191
271
  }
192
272
  }
@@ -210,7 +290,8 @@ function areObjectsEqualStrict(a, b, state) {
210
290
  // cost of anonymous callbacks.
211
291
  while (index-- > 0) {
212
292
  property = properties[index];
213
- if (!isPropertyEqual(a, b, state, property)) {
293
+ if (!isReactProperty(a, b, property)
294
+ && (!hasOwn(b, property) || !state.equals(a[property], b[property], property, property, a, b, state))) {
214
295
  return false;
215
296
  }
216
297
  descriptorA = getOwnPropertyDescriptor(a, property);
@@ -284,7 +365,11 @@ function areSetsEqual(a, b, state) {
284
365
  */
285
366
  function areTypedArraysEqual(a, b) {
286
367
  let index = a.length;
287
- if (b.length !== index || a.byteOffset !== b.byteOffset) {
368
+ // `byteOffset` is where the view starts in its buffer, not part of its value: two views holding
369
+ // the same elements are equal wherever they sit, the same as `DataView` and `ArrayBuffer`
370
+ // comparisons. Node.js `Buffer`s are views into a shared pool at varying offsets, so checking it
371
+ // would make equal `Buffer`s compare unequal.
372
+ if (b.length !== index) {
288
373
  return false;
289
374
  }
290
375
  // Only float-backed views can hold `NaN`, and the additional check needed to treat it as equal
@@ -312,52 +397,77 @@ function areTypedArraysEqual(a, b) {
312
397
  * Whether the URL instances are equal in value.
313
398
  */
314
399
  function areUrlsEqual(a, b) {
400
+ const hrefA = a.href;
401
+ const hrefB = b.href;
315
402
  // `href` is the normalized serialization of every component, so matching hrefs are equal without
316
403
  // any further work. Only a difference in query parameter ordering can survive a mismatch here.
317
- if (a.href === b.href) {
404
+ if (hrefA === hrefB) {
318
405
  return true;
319
406
  }
320
- return (a.protocol === b.protocol
321
- && a.username === b.username
322
- && a.password === b.password
323
- // `host` covers both the hostname and the port.
324
- && a.host === b.host
325
- && a.pathname === b.pathname
326
- && a.hash === b.hash
327
- && areSearchParamsEqual(a.searchParams, b.searchParams));
407
+ // Reordering the query's pairs preserves length, so equal URLs always have hrefs of equal length.
408
+ const length = hrefA.length;
409
+ if (length !== hrefB.length) {
410
+ return false;
411
+ }
412
+ // The rest of the URL is compared as serialized, rather than through the component getters, which
413
+ // hide some differences (`search` and `hash` are `''` for both `?` / `#` and a missing query /
414
+ // fragment). Every component before the query percent-encodes `?`, so the first one starts the
415
+ // query, or the fragment when there is no query.
416
+ const start = hrefA.indexOf('?');
417
+ if (start === -1 || start !== hrefB.indexOf('?') || hrefA.slice(0, start) !== hrefB.slice(0, start)) {
418
+ return false;
419
+ }
420
+ // The query percent-encodes `#`, so the first one starts the fragment. One before the `?` means
421
+ // that `?` is inside the fragment, so there is no query to reorder. The prefixes match, so that
422
+ // `#` is in both hrefs.
423
+ let end = hrefA.indexOf('#');
424
+ if (end === -1) {
425
+ if (hrefB.includes('#', start)) {
426
+ return false;
427
+ }
428
+ end = length;
429
+ }
430
+ else if (end < start || hrefB.indexOf('#', start) !== end || hrefA.slice(end) !== hrefB.slice(end)) {
431
+ return false;
432
+ }
433
+ const queryA = hrefA.slice(start + 1, end);
434
+ // Everything outside the query matches and the hrefs differ, so the queries differ, and a query
435
+ // with a single pair cannot be reordered.
436
+ return queryA.includes('&') && areSortedPairsEqual(queryA, hrefB.slice(start + 1, end));
328
437
  }
329
438
  /**
330
- * Whether the search params passed are equal in value.
439
+ * Whether two serialized query strings hold the same pairs, regardless of the order they appear in.
331
440
  *
332
441
  * @note
333
442
  * Order is not significant, matching how the other unordered collections in the library are
334
443
  * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:
335
444
  * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.
336
- */
337
- function areSearchParamsEqual(a, b) {
338
- const serializedA = a.toString();
339
- const serializedB = b.toString();
340
- // Identical serializations are equal under any ordering, and this is by far the common case, so
341
- // it is worth checking before sorting anything.
342
- return serializedA === serializedB || sortSearchParams(serializedA) === sortSearchParams(serializedB);
343
- }
344
- /**
345
- * Reorder a serialized query string so that params holding the same pairs compare as equal
346
- * regardless of the order they appear in.
347
445
  *
348
- * @note
349
- * The serializer percent-encodes `&` and `=` wherever they appear inside a name or a value, so
350
- * splitting on `&` recovers exactly the pairs and nothing else.
446
+ * In a URL's query as written, the parser treats every `&` as a separator, so splitting on it
447
+ * recovers exactly the pairs and nothing else. Empty pairs (from `a=1&` or `a=1&&b=2`) are kept, so
448
+ * they count like any other pair.
449
+ *
450
+ * Callers only reach this once they know the strings differ, so it does not check `===` first.
351
451
  */
352
- function sortSearchParams(serialized) {
353
- return serialized.split('&').sort().join('&');
354
- }
355
- function isPropertyEqual(a, b, state, property) {
356
- if ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)
357
- && (a.$$typeof || b.$$typeof)) {
358
- return true;
452
+ function areSortedPairsEqual(serializedA, serializedB) {
453
+ const pairsA = serializedA.split('&');
454
+ const pairsB = serializedB.split('&');
455
+ const length = pairsA.length;
456
+ if (length !== pairsB.length) {
457
+ return false;
458
+ }
459
+ pairsA.sort();
460
+ pairsB.sort();
461
+ // Comparing pair by pair stops at the first difference, rather than joining both back together.
462
+ for (let index = 0; index < length; ++index) {
463
+ if (pairsA[index] !== pairsB[index]) {
464
+ return false;
465
+ }
359
466
  }
360
- return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);
467
+ return true;
468
+ }
469
+ function isReactProperty(a, b, property) {
470
+ return ((property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && !!(a.$$typeof || b.$$typeof));
361
471
  }
362
472
 
363
473
  const ARRAY_BUFFER_TAG = '[object ArrayBuffer]';
@@ -555,13 +665,11 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
555
665
  areArraysEqual: strict ? areObjectsEqualStrict : areArraysEqual,
556
666
  areDataViewsEqual,
557
667
  areDatesEqual: areDatesEqual,
558
- // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),
559
- // which the error comparator alone does not see, so it is composed with the object comparator.
560
- // `name` / `message` / `stack` are own but not enumerable, which is why errors need a
561
- // comparator of their own rather than being treated as plain objects in the first place.
562
- areErrorsEqual: strict
563
- ? combineComparators(areErrorsEqual, areObjectsEqualStrict)
564
- : combineComparators(areErrorsEqual, areObjectsEqual),
668
+ // `name` / `message` / `stack` / `cause` / `errors` are not enumerable (unless assigned), which is why
669
+ // errors need a comparator of their own rather than being treated as plain objects. Each variant also
670
+ // compares the own properties that `Error` subclasses routinely carry (`status`, `code`, ...):
671
+ // enumerable ones in loose mode, and all of them (via `areObjectsEqualStrict`) in strict mode.
672
+ areErrorsEqual: strict ? areErrorsEqualStrict : areErrorsEqual,
565
673
  areFunctionsEqual: areFunctionsEqual,
566
674
  areMapsEqual: strict ? combineComparators(areMapsEqual, areObjectsEqualStrict) : areMapsEqual,
567
675
  areNumbersEqual: areNumbersEqual,
@@ -586,12 +694,15 @@ function createEqualityComparatorConfig({ circular, createCustomConfig, strict,
586
694
  const areMapsEqual = createIsCircular(config.areMapsEqual);
587
695
  const areObjectsEqual = createIsCircular(config.areObjectsEqual);
588
696
  const areSetsEqual = createIsCircular(config.areSetsEqual);
697
+ // Strict mode compares a TypedArray's own properties, which can reference the array itself.
698
+ const areTypedArraysEqual = strict ? createIsCircular(config.areTypedArraysEqual) : config.areTypedArraysEqual;
589
699
  config = Object.assign({}, config, {
590
700
  areArraysEqual,
591
701
  areErrorsEqual,
592
702
  areMapsEqual,
593
703
  areObjectsEqual,
594
704
  areSetsEqual,
705
+ areTypedArraysEqual,
595
706
  });
596
707
  }
597
708
  return config;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","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 * Identify the element type of TypedArrays across realms and subclasses.\n */\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst getTypedArrayTag = getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), Symbol.toStringTag)!.get!;\n\n/**\n * Whether the array buffers are equal in value.\n */\nexport function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\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 dataviews are equal in value.\n */\nexport function areDataViewsEqual(a: DataView, b: DataView): boolean {\n return (\n a.byteLength === b.byteLength\n && areTypedArraysEqual(\n new Uint8Array(a.buffer, a.byteOffset, a.byteLength),\n new Uint8Array(b.buffer, b.byteOffset, b.byteLength),\n )\n );\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, state: State<any>): boolean {\n return (\n a.name === b.name\n && a.message === b.message\n && a.stack === b.stack\n && state.equals(a.cause, b.cause, 'cause', 'cause', a, b, state)\n );\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 || a.byteOffset !== b.byteOffset) {\n return false;\n }\n\n // Only float-backed views can hold `NaN`, and the additional check needed to treat it as equal\n // to itself measurably slows the loop, so integer views keep the plain comparison. This is\n // hoisted out of the loop so the cost is paid once per call rather than once per element.\n const tag = getTypedArrayTag.call(a);\n\n if (tag === 'Float64Array' || tag === 'Float32Array' || tag === 'Float16Array') {\n while (index-- > 0) {\n // `NaN` is the only value not equal to itself, and it is treated as equal here to match\n // the SameValueZero semantics used for every other numeric comparison in the library.\n if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) {\n return false;\n }\n }\n\n return true;\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 // `href` is the normalized serialization of every component, so matching hrefs are equal without\n // any further work. Only a difference in query parameter ordering can survive a mismatch here.\n if (a.href === b.href) {\n return true;\n }\n\n return (\n a.protocol === b.protocol\n && a.username === b.username\n && a.password === b.password\n // `host` covers both the hostname and the port.\n && a.host === b.host\n && a.pathname === b.pathname\n && a.hash === b.hash\n && areSearchParamsEqual(a.searchParams, b.searchParams)\n );\n}\n\n/**\n * Whether the search params passed are equal in value.\n *\n * @note\n * Order is not significant, matching how the other unordered collections in the library are\n * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:\n * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.\n */\nfunction areSearchParamsEqual(a: URLSearchParams, b: URLSearchParams): boolean {\n const serializedA = a.toString();\n const serializedB = b.toString();\n\n // Identical serializations are equal under any ordering, and this is by far the common case, so\n // it is worth checking before sorting anything.\n return serializedA === serializedB || sortSearchParams(serializedA) === sortSearchParams(serializedB);\n}\n\n/**\n * Reorder a serialized query string so that params holding the same pairs compare as equal\n * regardless of the order they appear in.\n *\n * @note\n * The serializer percent-encodes `&` and `=` wherever they appear inside a name or a value, so\n * splitting on `&` recovers exactly the pairs and nothing else.\n */\nfunction sortSearchParams(serialized: string): string {\n return serialized.split('&').sort().join('&');\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 areArrayBuffersEqual,\n areArraysEqual as areArraysEqualDefault,\n areDataViewsEqual,\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 ARRAY_BUFFER_TAG = '[object ArrayBuffer]';\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATA_VIEW_TAG = '[object DataView]';\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 TYPED_ARRAY_TAGS: Record<string, boolean> = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float16Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true,\n '[object BigInt64Array]': true,\n '[object BigUint64Array]': true,\n};\nconst URL_TAG = '[object URL]';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\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 areArrayBuffersEqual,\n areArraysEqual,\n areDataViewsEqual,\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 (Array.isArray(a)) {\n return areArraysEqual(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 if (constructor == null) {\n // Objects with a prototype of `null` are plain objects.\n return areObjectsEqual(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 = toString.call(a);\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 if (TYPED_ARRAY_TAGS[tag]) {\n return areTypedArraysEqual(a, b, state);\n }\n\n if (tag === ARRAY_BUFFER_TAG) {\n return areArrayBuffersEqual(a, b, state);\n }\n\n if (tag === DATA_VIEW_TAG) {\n return areDataViewsEqual(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 areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDataViewsEqual,\n areDatesEqual: areDatesEqualDefault,\n // `Error` subclasses routinely carry their own enumerable properties (`status`, `code`, ...),\n // which the error comparator alone does not see, so it is composed with the object comparator.\n // `name` / `message` / `stack` are own but not enumerable, which is why errors need a\n // comparator of their own rather than being treated as plain objects in the first place.\n areErrorsEqual: strict\n ? combineComparators(areErrorsEqualDefault, areObjectsEqualStrictDefault)\n : combineComparators(areErrorsEqualDefault, areObjectsEqualDefault),\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\n ? combineComparators(areTypedArraysEqualDefault, areObjectsEqualStrictDefault)\n : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n // Errors are included because comparing `cause` and own properties by value means an error\n // that references itself would otherwise recurse without bound.\n const areErrorsEqual = createIsCircular(config.areErrorsEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = Object.assign({}, config, {\n areArraysEqual,\n areErrorsEqual,\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 });\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","areObjectsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","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;AACG,SAAU,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;AAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;AAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EA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AAA,MAAM,EAAE,IAAI;AACb,CAAA;AAED;;AAEG;AACI,MAAM,YAAY,GAAG,iBAAiB,CAAC;AAC5C,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AACnD,CAAA;AAED;;AAEG;AACI,MAAM,kBAAkB,GAAG,iBAAiB,CAAC;AAClD,IAAA,MAAM,EAAE,IAAI;AACZ,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AACnD,CAAA;AAED;;AAEG;AACI,MAAM,oBAAoB,GAAG,iBAAiB,CAAC;AACpD,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AACnD,CAAA;AAED;;;AAGG;AACI,MAAM,0BAA0B,GAAG,iBAAiB,CAAC;AAC1D,IAAA,QAAQ,EAAE,IAAI;AACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;AAClD,IAAA,MAAM,EAAE,IAAI;AACb,CAAA;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAmB,OAAA,GAA2C,EAAE,EAAA;AAC/F,IAAA,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,wBAAwB,EAAE,8BAA8B,EACxD,WAAW,EACX,MAAM,GAAG,KAAK,GACf,GAAG,OAAO;AAEX,IAAA,MAAM,MAAM,GAAG,8BAA8B,CAAO,OAAO,CAAC;AAC5D,IAAA,MAAM,UAAU,GAAG,wBAAwB,CAAC,MAAM,CAAC;IACnD,MAAM,MAAM,GAAG;AACb,UAAE,8BAA8B,CAAC,UAAU;AAC3C,UAAE,gCAAgC,CAAC,UAAU,CAAC;AAEhD,IAAA,OAAO,aAAa,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC7E;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","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\n/**\n * Above this many keys, out-of-position keys are checked with `propertyIsEnumerable` rather than by\n * scanning the other object's keys. Measured in V8: scanning wins up to 50 keys and loses from 100.\n */\nconst MAX_SCANNED_PROPERTIES = 64;\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { propertyIsEnumerable } = Object.prototype;\n\n/**\n * Identify the element type of TypedArrays across realms and subclasses.\n */\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst getTypedArrayTag = getOwnPropertyDescriptor(Object.getPrototypeOf(Int8Array.prototype), Symbol.toStringTag)!.get!;\n\n/**\n * Whether the array buffers are equal in value.\n */\nexport function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean {\n return a.byteLength === b.byteLength && areTypedArraysEqual(new Uint8Array(a), new Uint8Array(b));\n}\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 dataviews are equal in value.\n */\nexport function areDataViewsEqual(a: DataView, b: DataView): boolean {\n return (\n a.byteLength === b.byteLength\n && areTypedArraysEqual(\n new Uint8Array(a.buffer, a.byteOffset, a.byteLength),\n new Uint8Array(b.buffer, b.byteOffset, b.byteLength),\n )\n );\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 *\n * @note\n * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared\n * explicitly. `cause` and `errors` are compared by value rather than by reference, matching how\n * every other nested value in the comparison is treated. They are compared exactly once, regardless\n * of whether they were assigned (enumerable) or set by the constructor (non-enumerable). Other own\n * enumerable properties (which custom `Error` subclasses commonly add) are compared afterward.\n *\n * The own property comparison is inlined rather than extracted, which measured faster in V8 when\n * recursing through `cause`. Keep the bytecode under V8's 460-byte TurboFan inlining limit (383 bytes\n * at time of writing; check with `node --print-bytecode --print-bytecode-filter=areErrorsEqual`), or\n * this stops being inlined into its callers.\n */\nexport function areErrorsEqual(a: Error, b: Error, state: State<any>): boolean {\n if (a.name !== b.name || a.message !== b.message || a.stack !== b.stack) {\n return false;\n }\n\n const causeA = a.cause;\n const causeB = b.cause;\n\n if (causeA !== causeB && !state.equals(causeA, causeB, 'cause', 'cause', a, b, state)) {\n return false;\n }\n\n const errorsA = (a as AggregateError).errors;\n const errorsB = (b as AggregateError).errors;\n\n if (errorsA !== errorsB && !state.equals(errorsA, errorsB, 'errors', 'errors', a, b, state)) {\n return false;\n }\n\n const propertiesA = keys(a);\n const propertiesB = keys(b);\n\n let index = propertiesA.length;\n\n // Constructed errors rarely have enumerable own properties.\n if (!index && !propertiesB.length) {\n return true;\n }\n\n let compared = 0;\n let property: string;\n\n while (index-- > 0) {\n property = propertiesA[index]!;\n\n // Already compared above regardless of enumerability, so we can ignore them.\n if (property === 'cause' || property === 'errors') {\n continue;\n }\n\n // `propertyIsEnumerable` rather than `hasOwn`, so that a non-enumerable own property on `b` cannot\n // stand in for an enumerable one. Keys in the same position are trivially enumerable on `b`.\n if (\n (property !== propertiesB[index] && !propertyIsEnumerable.call(b, property))\n || !state.equals((a as Dictionary)[property], (b as Dictionary)[property], property, property, a, b, state)\n ) {\n return false;\n }\n\n ++compared;\n }\n\n // Every compared key is enumerable on `b`, so any of `b`'s keys left over must be `cause` / `errors`.\n const remaining = propertiesB.length - compared;\n\n return (\n !remaining\n || remaining === (propertyIsEnumerable.call(b, 'cause') ? 1 : 0) + (propertyIsEnumerable.call(b, 'errors') ? 1 : 0)\n );\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 errors passed are equal in value.\n *\n * @note\n * `name`, `message` and `stack` are own properties but are not enumerable, so they are compared\n * explicitly. `cause` and `errors` are own properties, so `areObjectsEqualStrict` compares them along\n * with every other own property; they are not compared explicitly to avoid comparing them twice.\n */\nexport function areErrorsEqualStrict(a: Error, b: Error, state: State<any>): boolean {\n return a.name === b.name && a.message === b.message && a.stack === b.stack && areObjectsEqualStrict(a, b, state);\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 const propertiesB = keys(b);\n\n let index = properties.length;\n\n if (propertiesB.length !== index) {\n return false;\n }\n\n const isScannable = index <= MAX_SCANNED_PROPERTIES;\n\n let property: string;\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 (isReactProperty(a, b, property)) {\n continue;\n }\n\n // Objects built the same way list their keys in the same order, in which case the key is\n // already known to be an own enumerable property of `b` and the lookup can be skipped.\n // Otherwise, `propertiesB` is exactly `b`'s own enumerable keys. Scanning it is faster than\n // `propertyIsEnumerable` for smaller objects, but it is linear per key, so larger objects\n // (where reordering would make it quadratic) use the lookup instead.\n if (\n (property !== propertiesB[index]\n && !(isScannable ? propertiesB.includes(property) : propertyIsEnumerable.call(b, property)))\n || !state.equals(a[property], b[property], property, property, a, b, state)\n ) {\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 (\n !isReactProperty(a, b, property)\n && (!hasOwn(b, property) || !state.equals(a[property], b[property], property, property, a, b, state))\n ) {\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 // `byteOffset` is where the view starts in its buffer, not part of its value: two views holding\n // the same elements are equal wherever they sit, the same as `DataView` and `ArrayBuffer`\n // comparisons. Node.js `Buffer`s are views into a shared pool at varying offsets, so checking it\n // would make equal `Buffer`s compare unequal.\n if (b.length !== index) {\n return false;\n }\n\n // Only float-backed views can hold `NaN`, and the additional check needed to treat it as equal\n // to itself measurably slows the loop, so integer views keep the plain comparison. This is\n // hoisted out of the loop so the cost is paid once per call rather than once per element.\n const tag = getTypedArrayTag.call(a);\n\n if (tag === 'Float64Array' || tag === 'Float32Array' || tag === 'Float16Array') {\n while (index-- > 0) {\n // `NaN` is the only value not equal to itself, and it is treated as equal here to match\n // the SameValueZero semantics used for every other numeric comparison in the library.\n if (a[index] !== b[index] && (a[index] === a[index] || b[index] === b[index])) {\n return false;\n }\n }\n\n return true;\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 const hrefA = a.href;\n const hrefB = b.href;\n\n // `href` is the normalized serialization of every component, so matching hrefs are equal without\n // any further work. Only a difference in query parameter ordering can survive a mismatch here.\n if (hrefA === hrefB) {\n return true;\n }\n\n // Reordering the query's pairs preserves length, so equal URLs always have hrefs of equal length.\n const length = hrefA.length;\n\n if (length !== hrefB.length) {\n return false;\n }\n\n // The rest of the URL is compared as serialized, rather than through the component getters, which\n // hide some differences (`search` and `hash` are `''` for both `?` / `#` and a missing query /\n // fragment). Every component before the query percent-encodes `?`, so the first one starts the\n // query, or the fragment when there is no query.\n const start = hrefA.indexOf('?');\n\n if (start === -1 || start !== hrefB.indexOf('?') || hrefA.slice(0, start) !== hrefB.slice(0, start)) {\n return false;\n }\n\n // The query percent-encodes `#`, so the first one starts the fragment. One before the `?` means\n // that `?` is inside the fragment, so there is no query to reorder. The prefixes match, so that\n // `#` is in both hrefs.\n let end = hrefA.indexOf('#');\n\n if (end === -1) {\n if (hrefB.includes('#', start)) {\n return false;\n }\n\n end = length;\n } else if (end < start || hrefB.indexOf('#', start) !== end || hrefA.slice(end) !== hrefB.slice(end)) {\n return false;\n }\n\n const queryA = hrefA.slice(start + 1, end);\n\n // Everything outside the query matches and the hrefs differ, so the queries differ, and a query\n // with a single pair cannot be reordered.\n return queryA.includes('&') && areSortedPairsEqual(queryA, hrefB.slice(start + 1, end));\n}\n\n/**\n * Whether two serialized query strings hold the same pairs, regardless of the order they appear in.\n *\n * @note\n * Order is not significant, matching how the other unordered collections in the library are\n * compared. Repeated keys are, so this is a comparison of multisets rather than of sets:\n * `a=1&a=2` is equal to `a=2&a=1`, but not to `a=1&a=1`.\n *\n * In a URL's query as written, the parser treats every `&` as a separator, so splitting on it\n * recovers exactly the pairs and nothing else. Empty pairs (from `a=1&` or `a=1&&b=2`) are kept, so\n * they count like any other pair.\n *\n * Callers only reach this once they know the strings differ, so it does not check `===` first.\n */\nfunction areSortedPairsEqual(serializedA: string, serializedB: string): boolean {\n const pairsA = serializedA.split('&');\n const pairsB = serializedB.split('&');\n const length = pairsA.length;\n\n if (length !== pairsB.length) {\n return false;\n }\n\n pairsA.sort();\n pairsB.sort();\n\n // Comparing pair by pair stops at the first difference, rather than joining both back together.\n for (let index = 0; index < length; ++index) {\n if (pairsA[index] !== pairsB[index]) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction isReactProperty(a: Dictionary, b: Dictionary, property: string | symbol): boolean {\n return (\n (property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE) && !!(a.$$typeof || b.$$typeof)\n );\n}\n","import {\n areArrayBuffersEqual,\n areArraysEqual as areArraysEqualDefault,\n areDataViewsEqual,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areErrorsEqualStrict as areErrorsEqualStrictDefault,\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 ARRAY_BUFFER_TAG = '[object ArrayBuffer]';\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATA_VIEW_TAG = '[object DataView]';\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 TYPED_ARRAY_TAGS: Record<string, boolean> = {\n '[object Int8Array]': true,\n '[object Uint8Array]': true,\n '[object Uint8ClampedArray]': true,\n '[object Int16Array]': true,\n '[object Uint16Array]': true,\n '[object Int32Array]': true,\n '[object Uint32Array]': true,\n '[object Float16Array]': true,\n '[object Float32Array]': true,\n '[object Float64Array]': true,\n '[object BigInt64Array]': true,\n '[object BigUint64Array]': true,\n};\nconst URL_TAG = '[object URL]';\n\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\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 areArrayBuffersEqual,\n areArraysEqual,\n areDataViewsEqual,\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 (Array.isArray(a)) {\n return areArraysEqual(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 if (constructor == null) {\n // Objects with a prototype of `null` are plain objects.\n return areObjectsEqual(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 = toString.call(a);\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 if (TYPED_ARRAY_TAGS[tag]) {\n return areTypedArraysEqual(a, b, state);\n }\n\n if (tag === ARRAY_BUFFER_TAG) {\n return areArrayBuffersEqual(a, b, state);\n }\n\n if (tag === DATA_VIEW_TAG) {\n return areDataViewsEqual(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 areArrayBuffersEqual,\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDataViewsEqual,\n areDatesEqual: areDatesEqualDefault,\n // `name` / `message` / `stack` / `cause` / `errors` are not enumerable (unless assigned), which is why\n // errors need a comparator of their own rather than being treated as plain objects. Each variant also\n // compares the own properties that `Error` subclasses routinely carry (`status`, `code`, ...):\n // enumerable ones in loose mode, and all of them (via `areObjectsEqualStrict`) in strict mode.\n areErrorsEqual: strict ? areErrorsEqualStrictDefault : 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\n ? combineComparators(areTypedArraysEqualDefault, areObjectsEqualStrictDefault)\n : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = Object.assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n // Errors are included because comparing `cause` and own properties by value means an error\n // that references itself would otherwise recurse without bound.\n const areErrorsEqual = createIsCircular(config.areErrorsEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n // Strict mode compares a TypedArray's own properties, which can reference the array itself.\n const areTypedArraysEqual = strict ? createIsCircular(config.areTypedArraysEqual) : config.areTypedArraysEqual;\n\n config = Object.assign({}, config, {\n areArraysEqual,\n areErrorsEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n areTypedArraysEqual,\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 });\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","areErrorsEqualStrictDefault","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;AACG,SAAU,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;AAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA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