fast-equals 5.0.0-beta.5 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/CHANGELOG.md +17 -1
  2. package/README.md +68 -48
  3. package/dist/cjs/index.cjs +165 -140
  4. package/dist/cjs/index.cjs.map +1 -1
  5. package/dist/cjs/types/comparator.d.ts +20 -3
  6. package/dist/cjs/types/equals.d.ts +5 -2
  7. package/dist/cjs/types/index.d.ts +9 -9
  8. package/dist/cjs/types/internalTypes.d.ts +100 -12
  9. package/dist/cjs/types/utils.d.ts +1 -6
  10. package/dist/esm/index.mjs +165 -140
  11. package/dist/esm/index.mjs.map +1 -1
  12. package/dist/esm/types/comparator.d.ts +20 -3
  13. package/dist/esm/types/equals.d.ts +5 -2
  14. package/dist/esm/types/index.d.ts +9 -9
  15. package/dist/esm/types/internalTypes.d.ts +100 -12
  16. package/dist/esm/types/utils.d.ts +1 -6
  17. package/dist/min/index.js +1 -1
  18. package/dist/min/types/comparator.d.ts +20 -3
  19. package/dist/min/types/equals.d.ts +5 -2
  20. package/dist/min/types/index.d.ts +9 -9
  21. package/dist/min/types/internalTypes.d.ts +100 -12
  22. package/dist/min/types/utils.d.ts +1 -6
  23. package/dist/umd/index.js +165 -140
  24. package/dist/umd/index.js.map +1 -1
  25. package/dist/umd/types/comparator.d.ts +20 -3
  26. package/dist/umd/types/equals.d.ts +5 -2
  27. package/dist/umd/types/index.d.ts +9 -9
  28. package/dist/umd/types/internalTypes.d.ts +100 -12
  29. package/dist/umd/types/utils.d.ts +1 -6
  30. package/package.json +7 -7
  31. package/recipes/legacy-circular-equal-support.md +3 -2
  32. package/recipes/legacy-regexp-support.md +2 -3
  33. package/recipes/non-standard-properties.md +4 -2
  34. package/src/comparator.ts +126 -38
  35. package/src/equals.ts +97 -63
  36. package/src/index.ts +21 -65
  37. package/src/internalTypes.ts +104 -16
  38. package/src/utils.ts +2 -24
@@ -8,15 +8,6 @@ function combineComparators(comparatorA, comparatorB) {
8
8
  return comparatorA(a, b, state) && comparatorB(a, b, state);
9
9
  };
10
10
  }
11
- /**
12
- * Default equality comparator pass-through, used as the standard `isEqual` creator for
13
- * use inside the built comparator.
14
- */
15
- function createInternalComparator(compare) {
16
- return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
17
- return compare(a, b, state);
18
- };
19
- }
20
11
  /**
21
12
  * Wrap the provided `areItemsEqual` method to manage the circular state, allowing
22
13
  * for circular references to be safely included in the comparison without creating
@@ -89,36 +80,42 @@ function areDatesEqual(a, b) {
89
80
  * Whether the `Map`s are equal in value.
90
81
  */
91
82
  function areMapsEqual(a, b, state) {
92
- var isValueEqual = a.size === b.size;
93
- if (isValueEqual && a.size) {
94
- // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
95
- // the inability to control the performance of the resulting code. It also avoids excessive
96
- // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
97
- // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
98
- // equality checks themselves.
99
- var matchedIndices_1 = {};
100
- var indexA_1 = 0;
101
- a.forEach(function (aValue, aKey) {
102
- if (!isValueEqual) {
103
- return;
83
+ if (a.size !== b.size) {
84
+ return false;
85
+ }
86
+ var matchedIndices = {};
87
+ var aIterable = a.entries();
88
+ var index = 0;
89
+ var aResult;
90
+ var bResult;
91
+ while ((aResult = aIterable.next())) {
92
+ if (aResult.done) {
93
+ break;
94
+ }
95
+ var bIterable = b.entries();
96
+ var hasMatch = false;
97
+ var matchIndex = 0;
98
+ while ((bResult = bIterable.next())) {
99
+ if (bResult.done) {
100
+ break;
104
101
  }
105
- var hasMatch = false;
106
- var matchIndexB = 0;
107
- b.forEach(function (bValue, bKey) {
108
- if (!hasMatch &&
109
- !matchedIndices_1[matchIndexB] &&
110
- (hasMatch =
111
- state.equals(aKey, bKey, indexA_1, matchIndexB, a, b, state) &&
112
- state.equals(aValue, bValue, aKey, bKey, a, b, state))) {
113
- matchedIndices_1[matchIndexB] = true;
114
- }
115
- matchIndexB++;
116
- });
117
- indexA_1++;
118
- isValueEqual = hasMatch;
119
- });
102
+ var _a = aResult.value, aKey = _a[0], aValue = _a[1];
103
+ var _b = bResult.value, bKey = _b[0], bValue = _b[1];
104
+ if (!hasMatch &&
105
+ !matchedIndices[matchIndex] &&
106
+ (hasMatch =
107
+ state.equals(aKey, bKey, index, matchIndex, a, b, state) &&
108
+ state.equals(aValue, bValue, aKey, bKey, a, b, state))) {
109
+ matchedIndices[matchIndex] = true;
110
+ }
111
+ matchIndex++;
112
+ }
113
+ if (!hasMatch) {
114
+ return false;
115
+ }
116
+ index++;
120
117
  }
121
- return isValueEqual;
118
+ return true;
122
119
  }
123
120
  /**
124
121
  * Whether the objects are equal in value.
@@ -206,33 +203,40 @@ function areRegExpsEqual(a, b) {
206
203
  * Whether the `Set`s are equal in value.
207
204
  */
208
205
  function areSetsEqual(a, b, state) {
209
- var isValueEqual = a.size === b.size;
210
- if (isValueEqual && a.size) {
211
- // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and
212
- // the inability to control the performance of the resulting code. It also avoids excessive
213
- // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,
214
- // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the
215
- // equality checks themselves.
216
- var matchedIndices_2 = {};
217
- a.forEach(function (aValue, aKey) {
218
- if (!isValueEqual) {
219
- return;
206
+ if (a.size !== b.size) {
207
+ return false;
208
+ }
209
+ var matchedIndices = {};
210
+ var aIterable = a.values();
211
+ var aResult;
212
+ var bResult;
213
+ while ((aResult = aIterable.next())) {
214
+ if (aResult.done) {
215
+ break;
216
+ }
217
+ var bIterable = b.values();
218
+ var hasMatch = false;
219
+ var matchIndex = 0;
220
+ while ((bResult = bIterable.next())) {
221
+ if (bResult.done) {
222
+ break;
220
223
  }
221
- var hasMatch = false;
222
- var matchIndex = 0;
223
- b.forEach(function (bValue, bKey) {
224
- if (!hasMatch &&
225
- !matchedIndices_2[matchIndex] &&
226
- (hasMatch = state.equals(aValue, bValue, aKey, bKey, a, b, state))) {
227
- matchedIndices_2[matchIndex] = true;
228
- }
229
- matchIndex++;
230
- });
231
- isValueEqual = hasMatch;
232
- });
224
+ if (!hasMatch &&
225
+ !matchedIndices[matchIndex] &&
226
+ (hasMatch = state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state))) {
227
+ matchedIndices[matchIndex] = true;
228
+ }
229
+ matchIndex++;
230
+ }
231
+ if (!hasMatch) {
232
+ return false;
233
+ }
233
234
  }
234
- return isValueEqual;
235
+ return true;
235
236
  }
237
+ /**
238
+ * Whether the TypedArray instances are equal in value.
239
+ */
236
240
  function areTypedArraysEqual(a, b) {
237
241
  var index = a.length;
238
242
  if (b.length !== index) {
@@ -264,7 +268,7 @@ var getTag = Object.prototype.toString.call.bind(Object.prototype.toString);
264
268
  /**
265
269
  * Create a comparator method based on the type-specific equality comparators passed.
266
270
  */
267
- function createComparator(_a) {
271
+ function createEqualityComparator(_a) {
268
272
  var areArraysEqual = _a.areArraysEqual, areDatesEqual = _a.areDatesEqual, areMapsEqual = _a.areMapsEqual, areObjectsEqual = _a.areObjectsEqual, arePrimitiveWrappersEqual = _a.arePrimitiveWrappersEqual, areRegExpsEqual = _a.areRegExpsEqual, areSetsEqual = _a.areSetsEqual, areTypedArraysEqual = _a.areTypedArraysEqual;
269
273
  /**
270
274
  * compare the value of the two objects and return true if they are equivalent in values
@@ -278,9 +282,13 @@ function createComparator(_a) {
278
282
  // of them being equal but not strictly is if they are both `NaN`. Since
279
283
  // `NaN` is uniquely not equal to itself, we can use self-comparison of
280
284
  // both objects, which is faster than `isNaN()`.
281
- if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {
285
+ if (a == null ||
286
+ b == null ||
287
+ typeof a !== 'object' ||
288
+ typeof b !== 'object') {
282
289
  return a !== a && b !== b;
283
290
  }
291
+ var constructor = a.constructor;
284
292
  // Checks are listed in order of commonality of use-case:
285
293
  // 1. Common complex object types (plain object, array)
286
294
  // 2. Common data values (date, regexp)
@@ -289,43 +297,47 @@ function createComparator(_a) {
289
297
  // Inherently this is both subjective and assumptive, however
290
298
  // when reviewing comparable libraries in the wild this order
291
299
  // appears to be generally consistent.
300
+ // Constructors should match, otherwise there is potential for false positives
301
+ // between class and subclass or custom object and POJO.
302
+ if (constructor !== b.constructor) {
303
+ return false;
304
+ }
292
305
  // `isPlainObject` only checks against the object's own realm. Cross-realm
293
306
  // comparisons are rare, and will be handled in the ultimate fallback, so
294
- // we can avoid the `toString.call()` cost unless necessary.
295
- if (a.constructor === Object && b.constructor === Object) {
307
+ // we can avoid capturing the string tag.
308
+ if (constructor === Object) {
296
309
  return areObjectsEqual(a, b, state);
297
310
  }
298
- // In strict mode, constructors should match. We placed this after the plain object check
299
- // because the constructors must match to meet plain object requirements (must both be `Object`
300
- // in the given Realm), so it slightly improves performance on a very common use-case.
301
- if (state.strict && a.constructor !== b.constructor) {
302
- return false;
311
+ // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing
312
+ // the string tag or doing an `instanceof` check.
313
+ if (isArray(a)) {
314
+ return areArraysEqual(a, b, state);
303
315
  }
304
- // `isArray()` works on subclasses and is cross-realm, so we can again avoid
305
- // the `toString.call()` cost unless necessary by just checking if either
306
- // and then both are arrays.
307
- var aArray = isArray(a);
308
- var bArray = isArray(b);
309
- if (aArray || bArray) {
310
- return aArray === bArray && areArraysEqual(a, b, state);
311
- }
312
- // Prioritize the `TypedArray` check because it does not require capturing the tag, which is a
313
- // slower path.
314
- if (isTypedArray) {
315
- aArray = isTypedArray(a);
316
- bArray = isTypedArray(b);
317
- if (aArray || bArray) {
318
- return aArray === bArray && areTypedArraysEqual(a, b, state);
319
- }
316
+ // `isTypedArray()` works on all possible TypedArray classes, so we can avoid
317
+ // capturing the string tag or comparing against all possible constructors.
318
+ if (isTypedArray != null && isTypedArray(a)) {
319
+ return areTypedArraysEqual(a, b, state);
320
320
  }
321
- // Since this is a custom object, use the classic `toString.call()` to get its
322
- // type. This is reasonably performant in modern environments like v8 and
323
- // SpiderMonkey, and allows for cross-realm comparison when other checks like
324
- // `instanceof` do not.
325
- var tag = getTag(a);
326
- if (tag !== getTag(b)) {
327
- return false;
321
+ // Try to fast-path equality checks for other complex object types in the
322
+ // same realm to avoid capturing the string tag. Strict equality is used
323
+ // instead of `instanceof` because it is more performant for the common
324
+ // use-case. If someone is subclassing a native class, it will be handled
325
+ // with the string tag comparison.
326
+ if (constructor === Date) {
327
+ return areDatesEqual(a, b, state);
328
+ }
329
+ if (constructor === RegExp) {
330
+ return areRegExpsEqual(a, b, state);
331
+ }
332
+ if (constructor === Map) {
333
+ return areMapsEqual(a, b, state);
328
334
  }
335
+ if (constructor === Set) {
336
+ return areSetsEqual(a, b, state);
337
+ }
338
+ // Since this is a custom object, capture the string tag to determing its type.
339
+ // This is reasonably performant in modern environments like v8 and SpiderMonkey.
340
+ var tag = getTag(a);
329
341
  if (tag === DATE_TAG) {
330
342
  return areDatesEqual(a, b, state);
331
343
  }
@@ -338,11 +350,9 @@ function createComparator(_a) {
338
350
  if (tag === SET_TAG) {
339
351
  return areSetsEqual(a, b, state);
340
352
  }
341
- // If a simple object tag, then we can prioritize a simple object comparison because
342
- // it is likely a custom class.
343
353
  if (tag === OBJECT_TAG) {
344
- // The exception for value comparison is `Promise`-like contracts. These should be
345
- // treated the same as standard `Promise` objects, which means strict equality, and if
354
+ // The exception for value comparison is custom `Promise`-like class instances. These should
355
+ // be treated the same as standard `Promise` objects, which means strict equality, and if
346
356
  // it reaches this point then that strict equality comparison has already failed.
347
357
  return (typeof a.then !== 'function' &&
348
358
  typeof b.then !== 'function' &&
@@ -375,7 +385,7 @@ function createComparator(_a) {
375
385
  /**
376
386
  * Create the configuration object used for building comparators.
377
387
  */
378
- function createComparatorConfig(_a) {
388
+ function createEqualityComparatorConfig(_a) {
379
389
  var circular = _a.circular, createCustomConfig = _a.createCustomConfig, strict = _a.strict;
380
390
  var config = {
381
391
  areArraysEqual: strict
@@ -394,7 +404,7 @@ function createComparatorConfig(_a) {
394
404
  ? combineComparators(areSetsEqual, areObjectsEqualStrict)
395
405
  : areSetsEqual,
396
406
  areTypedArraysEqual: strict
397
- ? combineComparators(areTypedArraysEqual, areObjectsEqualStrict)
407
+ ? areObjectsEqualStrict
398
408
  : areTypedArraysEqual,
399
409
  };
400
410
  if (createCustomConfig) {
@@ -414,6 +424,51 @@ function createComparatorConfig(_a) {
414
424
  }
415
425
  return config;
416
426
  }
427
+ /**
428
+ * Default equality comparator pass-through, used as the standard `isEqual` creator for
429
+ * use inside the built comparator.
430
+ */
431
+ function createInternalEqualityComparator(compare) {
432
+ return function (a, b, _indexOrKeyA, _indexOrKeyB, _parentA, _parentB, state) {
433
+ return compare(a, b, state);
434
+ };
435
+ }
436
+ /**
437
+ * Create the `isEqual` function used by the consuming application.
438
+ */
439
+ function createIsEqual(_a) {
440
+ var circular = _a.circular, comparator = _a.comparator, createState = _a.createState, equals = _a.equals, strict = _a.strict;
441
+ if (createState) {
442
+ return function isEqual(a, b) {
443
+ var _a = createState(), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, meta = _a.meta;
444
+ return comparator(a, b, {
445
+ cache: cache,
446
+ equals: equals,
447
+ meta: meta,
448
+ strict: strict,
449
+ });
450
+ };
451
+ }
452
+ if (circular) {
453
+ return function isEqual(a, b) {
454
+ return comparator(a, b, {
455
+ cache: new WeakMap(),
456
+ equals: equals,
457
+ meta: undefined,
458
+ strict: strict,
459
+ });
460
+ };
461
+ }
462
+ var state = {
463
+ cache: undefined,
464
+ equals: equals,
465
+ meta: undefined,
466
+ strict: strict,
467
+ };
468
+ return function isEqual(a, b) {
469
+ return comparator(a, b, state);
470
+ };
471
+ }
417
472
 
418
473
  /**
419
474
  * Whether the items passed are deeply-equal in value.
@@ -439,29 +494,29 @@ var strictCircularDeepEqual = createCustomEqual({
439
494
  * Whether the items passed are shallowly-equal in value.
440
495
  */
441
496
  var shallowEqual = createCustomEqual({
442
- comparator: sameValueZeroEqual,
497
+ createInternalComparator: function () { return sameValueZeroEqual; },
443
498
  });
444
499
  /**
445
500
  * Whether the items passed are shallowly-equal in value based on strict comparison
446
501
  */
447
502
  var strictShallowEqual = createCustomEqual({
448
- comparator: sameValueZeroEqual,
449
503
  strict: true,
504
+ createInternalComparator: function () { return sameValueZeroEqual; },
450
505
  });
451
506
  /**
452
507
  * Whether the items passed are shallowly-equal in value, including circular references.
453
508
  */
454
509
  var circularShallowEqual = createCustomEqual({
455
- comparator: sameValueZeroEqual,
456
510
  circular: true,
511
+ createInternalComparator: function () { return sameValueZeroEqual; },
457
512
  });
458
513
  /**
459
514
  * Whether the items passed are shallowly-equal in value, including circular references,
460
515
  * based on strict comparison.
461
516
  */
462
517
  var strictCircularShallowEqual = createCustomEqual({
463
- comparator: sameValueZeroEqual,
464
518
  circular: true,
519
+ createInternalComparator: function () { return sameValueZeroEqual; },
465
520
  strict: true,
466
521
  });
467
522
  /**
@@ -474,43 +529,13 @@ var strictCircularShallowEqual = createCustomEqual({
474
529
  */
475
530
  function createCustomEqual(options) {
476
531
  if (options === void 0) { options = {}; }
477
- var circular = options.circular, comparator = options.comparator, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _a = options.strict, baseStrict = _a === void 0 ? false : _a;
478
- var config = createComparatorConfig(options);
479
- var isEqualCustom = createComparator(config);
480
- var isEqualCustomComparator = comparator ||
481
- (createCustomInternalComparator
482
- ? createCustomInternalComparator(isEqualCustom)
483
- : createInternalComparator(isEqualCustom));
484
- if (createState) {
485
- return function isEqual(a, b, metaOverride) {
486
- var _a = createState(isEqualCustom), _b = _a.cache, cache = _b === void 0 ? circular ? new WeakMap() : undefined : _b, _c = _a.equals, equals = _c === void 0 ? isEqualCustomComparator : _c, meta = _a.meta, _d = _a.strict, strict = _d === void 0 ? baseStrict : _d;
487
- return isEqualCustom(a, b, {
488
- cache: cache,
489
- equals: equals,
490
- meta: metaOverride !== undefined ? metaOverride : meta,
491
- strict: strict,
492
- });
493
- };
494
- }
495
- if (circular) {
496
- return function equals(a, b) {
497
- return isEqualCustom(a, b, {
498
- cache: new WeakMap(),
499
- equals: isEqualCustomComparator,
500
- meta: undefined,
501
- strict: baseStrict,
502
- });
503
- };
504
- }
505
- var state = Object.freeze({
506
- cache: undefined,
507
- equals: isEqualCustomComparator,
508
- meta: undefined,
509
- strict: baseStrict,
510
- });
511
- return function equals(a, b) {
512
- return isEqualCustom(a, b, state);
513
- };
532
+ var _a = options.circular, circular = _a === void 0 ? false : _a, createCustomInternalComparator = options.createInternalComparator, createState = options.createState, _b = options.strict, strict = _b === void 0 ? false : _b;
533
+ var config = createEqualityComparatorConfig(options);
534
+ var comparator = createEqualityComparator(config);
535
+ var equals = createCustomInternalComparator
536
+ ? createCustomInternalComparator(comparator)
537
+ : createInternalEqualityComparator(comparator);
538
+ return createIsEqual({ circular: circular, comparator: comparator, createState: createState, equals: equals, strict: strict });
514
539
  }
515
540
 
516
541
  export { circularDeepEqual, circularShallowEqual, createCustomEqual, deepEqual, sameValueZeroEqual, shallowEqual, strictCircularDeepEqual, strictCircularShallowEqual, strictDeepEqual, strictShallowEqual };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/utils.ts","../../src/equals.ts","../../src/comparator.ts","../../src/index.ts"],"sourcesContent":["import {\n AnyEqualityComparator,\n BaseCircular,\n CircularState,\n Dictionary,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n TypeEqualityComparator,\n} from './internalTypes';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\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 * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalComparator<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 * 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<\n AreItemsEqual extends TypeEqualityComparator<any, any>,\n>(areItemsEqual: AreItemsEqual): AreItemsEqual {\n return function isCircular(\n a: any,\n b: any,\n state: CircularState<BaseCircular>,\n ) {\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 properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(\n object: Dictionary,\n): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(\n getOwnPropertySymbols(object),\n );\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n Object.hasOwn ||\n ((object: Dictionary, property: number | string | symbol) =>\n 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 === b || (a !== a && b !== b);\n}\n","import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils';\nimport type { Dictionary, State, TypedArray } from './internalTypes';\n\nconst 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 `Map`s are equal in value.\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n state: State<any>,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (isValueEqual && a.size) {\n // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and\n // the inability to control the performance of the resulting code. It also avoids excessive\n // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,\n // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the\n // equality checks themselves.\n\n const matchedIndices: Record<number, true> = {};\n\n let indexA = 0;\n\n a.forEach((aValue, aKey) => {\n if (!isValueEqual) {\n return;\n }\n\n let hasMatch = false;\n let matchIndexB = 0;\n\n b.forEach((bValue, bKey) => {\n if (\n !hasMatch &&\n !matchedIndices[matchIndexB] &&\n (hasMatch =\n state.equals(aKey, bKey, indexA, matchIndexB, a, b, state) &&\n state.equals(aValue, bValue, aKey, bKey, a, b, state))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n }\n\n return isValueEqual;\n}\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): 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 let property: string | symbol;\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 property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (\n !hasOwn(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(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): 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 property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (!hasOwn(b, property)) {\n return false;\n }\n\n if (\n !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: Date, b: Date): 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(\n a: Set<any>,\n b: Set<any>,\n state: State<any>,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (isValueEqual && a.size) {\n // The use of `forEach()` is to avoid the transpilation cost of `for...of` comparisons, and\n // the inability to control the performance of the resulting code. It also avoids excessive\n // iteration compared to doing comparisons of `keys()` and `values()`. As a result, though,\n // we cannot short-circuit the iterations; bookkeeping must be done to short-circuit the\n // equality checks themselves.\n\n const matchedIndices: Record<number, true> = {};\n\n a.forEach((aValue, aKey) => {\n if (!isValueEqual) {\n return;\n }\n\n let hasMatch = false;\n let matchIndex = 0;\n\n b.forEach((bValue, bKey) => {\n if (\n !hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch = state.equals(aValue, bValue, aKey, bKey, a, b, state))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n }\n\n return isValueEqual;\n}\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","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual,\n} from './equals';\nimport { combineComparators, createIsCircular } from './utils';\nimport type {\n ComparatorConfig,\n CustomEqualCreatorOptions,\n EqualityComparator,\n State,\n} from './internalTypes';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\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]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nconst { assign } = Object;\nconst getTag = Object.prototype.toString.call.bind(\n Object.prototype.toString,\n) as (a: object) => string;\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\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 the items are not non-nullish objects, then the only possibility\n // of them being equal but not strictly is if they are both `NaN`. Since\n // `NaN` is uniquely not equal to itself, we can use self-comparison of\n // both objects, which is faster than `isNaN()`.\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return a !== a && b !== b;\n }\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 // `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 the `toString.call()` cost unless necessary.\n if (a.constructor === Object && b.constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // In strict mode, constructors should match. We placed this after the plain object check\n // because the constructors must match to meet plain object requirements (must both be `Object`\n // in the given Realm), so it slightly improves performance on a very common use-case.\n if (state.strict && a.constructor !== b.constructor) {\n return false;\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can again avoid\n // the `toString.call()` cost unless necessary by just checking if either\n // and then both are arrays.\n let aArray = isArray(a);\n let bArray = isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, state);\n }\n\n // Prioritize the `TypedArray` check because it does not require capturing the tag, which is a\n // slower path.\n if (isTypedArray) {\n aArray = isTypedArray(a);\n bArray = isTypedArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areTypedArraysEqual(a, b, state);\n }\n }\n\n // Since this is a custom object, use the classic `toString.call()` to get its\n // type. This is reasonably performant in modern environments like v8 and\n // SpiderMonkey, and allows for cross-realm comparison when other checks like\n // `instanceof` do not.\n const tag = getTag(a);\n\n if (tag !== getTag(b)) {\n return false;\n }\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\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 a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class.\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is `Promise`-like contracts. These should be\n // 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 (\n typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state)\n );\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 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 createComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areMapsEqual: strict\n ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault)\n : areMapsEqualDefault,\n areObjectsEqual: strict\n ? areObjectsEqualStrictDefault\n : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict\n ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault)\n : areSetsEqualDefault,\n areTypedArraysEqual: strict\n ? combineComparators(areTypedArraysEqual, areObjectsEqualStrictDefault)\n : areTypedArraysEqual,\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","import { createComparator, createComparatorConfig } from './comparator';\nimport type {\n CircularState,\n CustomEqualCreatorOptions,\n DefaultState,\n} from './internalTypes';\nimport { createInternalComparator, sameValueZeroEqual } from './utils';\n\nexport { sameValueZeroEqual };\nexport * from './internalTypes';\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 comparator: sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n comparator: sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n comparator: sameValueZeroEqual,\n circular: true,\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 comparator: sameValueZeroEqual,\n circular: true,\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>(\n options: CustomEqualCreatorOptions<Meta> = {},\n) {\n const {\n circular,\n comparator,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict: baseStrict = false,\n } = options;\n\n const config = createComparatorConfig<Meta>(options);\n const isEqualCustom = createComparator(config);\n const isEqualCustomComparator =\n comparator ||\n (createCustomInternalComparator\n ? createCustomInternalComparator(isEqualCustom)\n : createInternalComparator(isEqualCustom));\n\n if (createState) {\n return function isEqual<A, B>(\n a: A,\n b: B,\n metaOverride?: Meta | undefined,\n ): boolean {\n const {\n cache = circular ? new WeakMap() : undefined,\n equals = isEqualCustomComparator,\n meta,\n strict = baseStrict,\n } = createState!(isEqualCustom);\n\n return isEqualCustom(a, b, {\n cache,\n equals,\n meta: metaOverride !== undefined ? metaOverride : meta,\n strict,\n } as CircularState<Meta>);\n };\n }\n\n if (circular) {\n return function equals<A, B>(a: A, b: B): boolean {\n return isEqualCustom(a, b, {\n cache: new WeakMap(),\n equals: isEqualCustomComparator,\n meta: undefined as Meta,\n strict: baseStrict,\n } as CircularState<Meta>);\n };\n }\n\n const state = Object.freeze({\n cache: undefined,\n equals: isEqualCustomComparator,\n meta: undefined,\n strict: baseStrict,\n });\n\n return function equals<A, B>(a: A, b: B): boolean {\n return isEqualCustom(a, b, state as DefaultState<Meta>);\n };\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areMapsEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areArraysEqual","areMapsEqual","areObjectsEqual","areSetsEqual"],"mappings":"AAWQ,IAAA,mBAAmB,GAA4B,MAAM,CAAA,mBAAlC,EAAE,qBAAqB,GAAK,MAAM,CAAA,qBAAX,CAAY;AACtD,IAAA,cAAc,GAAK,MAAM,CAAC,SAAS,eAArB,CAAsB;AAE5C;;AAEG;AACa,SAAA,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;AAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;AAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9D,KAAC,CAAC;AACJ,CAAC;AAED;;;AAGG;AACG,SAAU,wBAAwB,CACtC,OAAiC,EAAA;AAEjC,IAAA,OAAO,UACL,CAAM,EACN,CAAM,EACN,YAAiB,EACjB,YAAiB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uBAAuB,GAAA,EAAA,EAChC,IAAI,GAAA,EAAA,CAAA,IAAA,EACJ,EAAmB,GAAA,EAAA,CAAA,MAAA,EAAnB,MAAM,GAAG,EAAA,KAAA,KAAA,CAAA,GAAA,UAAU,KACU,CAAC;AAEhC,YAAA,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE;AACzB,gBAAA,KAAK,EAAA,KAAA;AACL,gBAAA,MAAM,EAAA,MAAA;gBACN,IAAI,EAAE,YAAY,KAAK,SAAS,GAAG,YAAY,GAAG,IAAI;AACtD,gBAAA,MAAM,EAAA,MAAA;AACgB,aAAA,CAAC,CAAC;AAC5B,SAAC,CAAC;AACH,KAAA;AAED,IAAA,IAAI,QAAQ,EAAE;AACZ,QAAA,OAAO,SAAS,MAAM,CAAO,CAAI,EAAE,CAAI,EAAA;AACrC,YAAA,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE;gBACzB,KAAK,EAAE,IAAI,OAAO,EAAE;AACpB,gBAAA,MAAM,EAAE,uBAAuB;AAC/B,gBAAA,IAAI,EAAE,SAAiB;AACvB,gBAAA,MAAM,EAAE,UAAU;AACI,aAAA,CAAC,CAAC;AAC5B,SAAC,CAAC;AACH,KAAA;AAED,IAAA,IAAM,KAAK,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1B,QAAA,KAAK,EAAE,SAAS;AAChB,QAAA,MAAM,EAAE,uBAAuB;AAC/B,QAAA,IAAI,EAAE,SAAS;AACf,QAAA,MAAM,EAAE,UAAU;AACnB,KAAA,CAAC,CAAC;AAEH,IAAA,OAAO,SAAS,MAAM,CAAO,CAAI,EAAE,CAAI,EAAA;QACrC,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,KAA2B,CAAC,CAAC;AAC1D,KAAC,CAAC;AACJ;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/utils.ts","../../src/equals.ts","../../src/comparator.ts","../../src/index.ts"],"sourcesContent":["import {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\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<\n AreItemsEqual extends TypeEqualityComparator<any, any>,\n>(areItemsEqual: AreItemsEqual): AreItemsEqual {\n return function isCircular(\n a: any,\n b: any,\n state: CircularState<Cache<any, any>>,\n ) {\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 properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(\n object: Dictionary,\n): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(\n getOwnPropertySymbols(object),\n );\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n Object.hasOwn ||\n ((object: Dictionary, property: number | string | symbol) =>\n 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 === b || (a !== a && b !== b);\n}\n","import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils';\nimport type {\n Dictionary,\n PrimitiveWrapper,\n State,\n TypedArray,\n} from './internalTypes';\n\nconst 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 `Map`s are equal in value.\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n state: State<any>,\n): boolean {\n if (a.size !== b.size) {\n return false;\n }\n\n const matchedIndices: Record<number, true> = {};\n const aIterable = a.entries();\n\n let index = 0;\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n\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 while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n const [aKey, aValue] = aResult.value;\n const [bKey, bValue] = bResult.value;\n\n if (\n !hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch =\n state.equals(aKey, bKey, index, matchIndex, a, b, state) &&\n state.equals(aValue, bValue, aKey, bKey, a, b, state))\n ) {\n matchedIndices[matchIndex] = true;\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 objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): 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 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 (\n property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (\n !hasOwn(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(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): 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 property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (!hasOwn(b, property)) {\n return false;\n }\n\n if (\n !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(\n a: PrimitiveWrapper,\n b: PrimitiveWrapper,\n): 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(\n a: Set<any>,\n b: Set<any>,\n state: State<any>,\n): boolean {\n if (a.size !== b.size) {\n return false;\n }\n\n const matchedIndices: Record<number, true> = {};\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\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 while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !hasMatch &&\n !matchedIndices[matchIndex] &&\n (hasMatch = state.equals(\n aResult.value,\n bResult.value,\n aResult.value,\n bResult.value,\n a,\n b,\n state,\n ))\n ) {\n matchedIndices[matchIndex] = true;\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","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual,\n} from './equals';\nimport { combineComparators, createIsCircular } from './utils';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\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]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nconst { assign } = Object;\nconst getTag = Object.prototype.toString.call.bind(\n Object.prototype.toString,\n) 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 areMapsEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\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 the items are not non-nullish objects, then the only possibility\n // of them being equal but not strictly is if they are both `NaN`. Since\n // `NaN` is uniquely not equal to itself, we can use self-comparison of\n // both objects, which is faster than `isNaN()`.\n if (\n a == null ||\n b == null ||\n typeof a !== 'object' ||\n typeof b !== 'object'\n ) {\n return a !== a && b !== b;\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);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\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 (\n typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state)\n );\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 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\n ? areObjectsEqualStrictDefault\n : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areMapsEqual: strict\n ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault)\n : areMapsEqualDefault,\n areObjectsEqual: strict\n ? areObjectsEqualStrictDefault\n : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict\n ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault)\n : areSetsEqualDefault,\n areTypedArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areTypedArraysEqual,\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>({\n circular,\n comparator,\n createState,\n equals,\n strict,\n}: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } =\n 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';\nimport type { CustomEqualCreatorOptions } from './internalTypes';\nimport { sameValueZeroEqual } from './utils';\n\nexport { sameValueZeroEqual };\nexport * from './internalTypes';\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>(\n options: CustomEqualCreatorOptions<Meta> = {},\n) {\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","areMapsEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areArraysEqual","areMapsEqual","areObjectsEqual","areSetsEqual"],"mappings":"AASQ,IAAA,mBAAmB,GAA4B,MAAM,CAAA,mBAAlC,E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A,EAAE,MAAM,EAAA,MAAA,EAAE,MAAM,EAAA,MAAA,EAAE,CAAC,CAAC;AAC9E;;;;"}
@@ -1,9 +1,26 @@
1
- import type { ComparatorConfig, CustomEqualCreatorOptions, EqualityComparator } from './internalTypes';
1
+ import type { ComparatorConfig, CreateState, CustomEqualCreatorOptions, EqualityComparator, InternalEqualityComparator } from './internalTypes';
2
+ interface CreateIsEqualOptions<Meta> {
3
+ circular: boolean;
4
+ comparator: EqualityComparator<Meta>;
5
+ createState: CreateState<Meta> | undefined;
6
+ equals: InternalEqualityComparator<Meta>;
7
+ strict: boolean;
8
+ }
2
9
  /**
3
10
  * Create a comparator method based on the type-specific equality comparators passed.
4
11
  */
5
- export declare function createComparator<Meta>({ areArraysEqual, areDatesEqual, areMapsEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
12
+ export declare function createEqualityComparator<Meta>({ areArraysEqual, areDatesEqual, areMapsEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
6
13
  /**
7
14
  * Create the configuration object used for building comparators.
8
15
  */
9
- export declare function createComparatorConfig<Meta>({ circular, createCustomConfig, strict, }: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta>;
16
+ export declare function createEqualityComparatorConfig<Meta>({ circular, createCustomConfig, strict, }: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta>;
17
+ /**
18
+ * Default equality comparator pass-through, used as the standard `isEqual` creator for
19
+ * use inside the built comparator.
20
+ */
21
+ export declare function createInternalEqualityComparator<Meta>(compare: EqualityComparator<Meta>): InternalEqualityComparator<Meta>;
22
+ /**
23
+ * Create the `isEqual` function used by the consuming application.
24
+ */
25
+ export declare function createIsEqual<Meta>({ circular, comparator, createState, equals, strict, }: CreateIsEqualOptions<Meta>): <A, B>(a: A, b: B) => boolean;
26
+ export {};