fast-equals 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # fast-equals CHANGELOG
2
2
 
3
+ ## 4.0.3
4
+
5
+ - Remove unnecessary second strict equality check for objects in edge-case scenarios
6
+
3
7
  ## 4.0.2
4
8
 
5
9
  - [#85](https://github.com/planttheidea/fast-equals/issues/85) - `createCustomCircularEqual` typing is incorrect
package/README.md CHANGED
@@ -210,7 +210,7 @@ Some recipes have been created to provide examples of use-cases for `createCusto
210
210
  - [Explicit property check](./recipes/explicit-property-check.md)
211
211
  - [Using `meta` in comparison](./recipes//using-meta-in-comparison.md)
212
212
  - [Comparing non-standard properties](./recipes/non-standard-properties.md)
213
- - [Strict property descriptor comparison](./recipes/strict-equality-checks.md)
213
+ - [Strict property descriptor comparison](./recipes/strict-property-descriptor-check.md)
214
214
 
215
215
  ### `createCustomCircularEqual`
216
216
 
@@ -69,10 +69,9 @@ function isPromiseLike(value) {
69
69
  /**
70
70
  * Whether the values passed are strictly equal or both NaN.
71
71
  */
72
- var sameValueZeroEqual = Object.is ||
73
- function sameValueZeroEqual(a, b) {
74
- return a === b || (a !== a && b !== b);
75
- };
72
+ function sameValueZeroEqual(a, b) {
73
+ return a === b || (a !== a && b !== b);
74
+ }
76
75
 
77
76
  var ARGUMENTS_TAG = '[object Arguments]';
78
77
  var BOOLEAN_TAG = '[object Boolean]';
@@ -153,7 +152,7 @@ function createComparator(_a) {
153
152
  // The exception for value comparison is `Promise`-like contracts. These should be
154
153
  // treated the same as standard `Promise` objects, which means strict equality.
155
154
  return isPromiseLike(a) || isPromiseLike(b)
156
- ? a === b
155
+ ? false
157
156
  : areObjectsEqual(a, b, isEqual, meta);
158
157
  }
159
158
  // As the penultimate fallback, check if the values passed are primitive wrappers. This
@@ -162,18 +161,18 @@ function createComparator(_a) {
162
161
  if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
163
162
  return sameValueZeroEqual(a.valueOf(), b.valueOf());
164
163
  }
165
- // If not matching any tags that require a specific type of comparison, then use strict
166
- // equality. This is for a few reasons:
167
- // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), this is the only
164
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
165
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
166
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
168
167
  // comparison that can be made.
169
168
  // - For types that can be introspected, but rarely have requirements to be compared
170
169
  // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
171
- // use-cases.
172
- // - For types that can be introspected, but do not have an objective definition of what
173
- // equality is (`Error`, etc.), the subjective decision was to be conservative.
170
+ // use-cases (may be included in a future release, if requested enough).
171
+ // - For types that can be introspected but do not have an objective definition of what
172
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
174
173
  // In all cases, these decisions should be reevaluated based on changes to the language and
175
174
  // common development practices.
176
- return a === b;
175
+ return false;
177
176
  }
178
177
  return comparator;
179
178
  }
@@ -259,14 +258,13 @@ var areMapsEqualCircular = createIsCircular(areMapsEqual);
259
258
 
260
259
  var OWNER = '_owner';
261
260
  var hasOwnProperty = Object.prototype.hasOwnProperty;
262
- var getProperties = Object.keys;
263
261
  /**
264
262
  * Whether the objects are equal in value.
265
263
  */
266
264
  function areObjectsEqual(a, b, isEqual, meta) {
267
- var keysA = getProperties(a);
265
+ var keysA = Object.keys(a);
268
266
  var index = keysA.length;
269
- if (getProperties(b).length !== index) {
267
+ if (Object.keys(b).length !== index) {
270
268
  return false;
271
269
  }
272
270
  var key;
@@ -1 +1 @@
1
- {"version":3,"file":"fast-equals.cjs.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport const sameValueZeroEqual =\n Object.is ||\n function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (a !== a && b !== b);\n };\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? a === b\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n }\n\n // If not matching any tags that require a specific type of comparison, then use strict\n // equality. This is for a few reasons:\n // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), 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.\n // - For types that can be introspected, but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision was to be conservative.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return a === b;\n }\n\n return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\nconst getProperties = Object.keys;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = getProperties(a);\n\n let index = keysA.length;\n\n if (getProperties(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":";;;;AAMA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;AAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,QAAa,EACb,QAAa,EACb,IAAU,EAAA;QAEV,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAChC,KAAC,CAAC;AACJ,CAAC;AAED;;;;AAIG;AACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;IAC5B,OAAO,SAAS,UAAU,CACxB,CAAM,EAC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BAA8B,CAAC,CACrD,CACF,CAAC;AAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;QAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;AAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;;;;;;;"}
1
+ {"version":3,"file":"fast-equals.cjs.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\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 !== a && b !== b);\n}\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? false\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\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 return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = Object.keys(a);\n\n let index = keysA.length;\n\n if (Object.keys(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\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,IAAI,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAC/B,oBAAgD,EAAA;AAEhD,IAAA,OAAO,gBAAgB,CACrB,KAAK,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAqB,CAAC,CAAC,CACnE,CAAC;AACJ,CAAC;AAED;;;;;;;;;AASG;AACG,SAAU,yBAAyB,CAEvC,oBAAgD,EAAA;AAChD,IAAA,IAAM,UAAU,GAAG,gBAAgB,CACjC,KAAK,CACH,uBAAuB,EACvB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;AAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;QAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;AAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;;;;;;;"}
@@ -65,10 +65,9 @@ function isPromiseLike(value) {
65
65
  /**
66
66
  * Whether the values passed are strictly equal or both NaN.
67
67
  */
68
- var sameValueZeroEqual = Object.is ||
69
- function sameValueZeroEqual(a, b) {
70
- return a === b || (a !== a && b !== b);
71
- };
68
+ function sameValueZeroEqual(a, b) {
69
+ return a === b || (a !== a && b !== b);
70
+ }
72
71
 
73
72
  var ARGUMENTS_TAG = '[object Arguments]';
74
73
  var BOOLEAN_TAG = '[object Boolean]';
@@ -149,7 +148,7 @@ function createComparator(_a) {
149
148
  // The exception for value comparison is `Promise`-like contracts. These should be
150
149
  // treated the same as standard `Promise` objects, which means strict equality.
151
150
  return isPromiseLike(a) || isPromiseLike(b)
152
- ? a === b
151
+ ? false
153
152
  : areObjectsEqual(a, b, isEqual, meta);
154
153
  }
155
154
  // As the penultimate fallback, check if the values passed are primitive wrappers. This
@@ -158,18 +157,18 @@ function createComparator(_a) {
158
157
  if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
159
158
  return sameValueZeroEqual(a.valueOf(), b.valueOf());
160
159
  }
161
- // If not matching any tags that require a specific type of comparison, then use strict
162
- // equality. This is for a few reasons:
163
- // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), this is the only
160
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
161
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
162
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
164
163
  // comparison that can be made.
165
164
  // - For types that can be introspected, but rarely have requirements to be compared
166
165
  // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
167
- // use-cases.
168
- // - For types that can be introspected, but do not have an objective definition of what
169
- // equality is (`Error`, etc.), the subjective decision was to be conservative.
166
+ // use-cases (may be included in a future release, if requested enough).
167
+ // - For types that can be introspected but do not have an objective definition of what
168
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
170
169
  // In all cases, these decisions should be reevaluated based on changes to the language and
171
170
  // common development practices.
172
- return a === b;
171
+ return false;
173
172
  }
174
173
  return comparator;
175
174
  }
@@ -255,14 +254,13 @@ var areMapsEqualCircular = createIsCircular(areMapsEqual);
255
254
 
256
255
  var OWNER = '_owner';
257
256
  var hasOwnProperty = Object.prototype.hasOwnProperty;
258
- var getProperties = Object.keys;
259
257
  /**
260
258
  * Whether the objects are equal in value.
261
259
  */
262
260
  function areObjectsEqual(a, b, isEqual, meta) {
263
- var keysA = getProperties(a);
261
+ var keysA = Object.keys(a);
264
262
  var index = keysA.length;
265
- if (getProperties(b).length !== index) {
263
+ if (Object.keys(b).length !== index) {
266
264
  return false;
267
265
  }
268
266
  var key;
@@ -1 +1 @@
1
- {"version":3,"file":"fast-equals.esm.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport const sameValueZeroEqual =\n Object.is ||\n function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (a !== a && b !== b);\n };\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? a === b\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n }\n\n // If not matching any tags that require a specific type of comparison, then use strict\n // equality. This is for a few reasons:\n // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), 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.\n // - For types that can be introspected, but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision was to be conservative.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return a === b;\n }\n\n return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\nconst getProperties = Object.keys;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = getProperties(a);\n\n let index = keysA.length;\n\n if (getProperties(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":"AAMA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;AAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,QAAa,EACb,QAAa,EACb,IAAU,EAAA;QAEV,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAChC,KAAC,CAAC;AACJ,CAAC;AAED;;;;AAIG;AACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;IAC5B,OAAO,SAAS,U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vB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;AAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;QAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;AAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;"}
1
+ {"version":3,"file":"fast-equals.esm.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\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 !== a && b !== b);\n}\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? false\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\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 return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = Object.keys(a);\n\n let index = keysA.length;\n\n if (Object.keys(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\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C,EAAE,IAAI,OAAO,EAAE,CAAC,CAAC;AACrD,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAC/B,oBAAgD,EAAA;AAEhD,IAAA,OAAO,gBAAgB,CACrB,KAAK,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAqB,CAAC,CAAC,CACnE,CAAC;AACJ,CAAC;AAED;;;;;;;;;AASG;AACG,SAAU,yBAAyB,CAEvC,oBAAgD,EAAA;AAChD,IAAA,IAAM,UAAU,GAAG,gBAAgB,CACjC,KAAK,CACH,uBAAuB,EACvB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;AAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;QAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;AAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;"}
@@ -71,10 +71,9 @@
71
71
  /**
72
72
  * Whether the values passed are strictly equal or both NaN.
73
73
  */
74
- var sameValueZeroEqual = Object.is ||
75
- function sameValueZeroEqual(a, b) {
76
- return a === b || (a !== a && b !== b);
77
- };
74
+ function sameValueZeroEqual(a, b) {
75
+ return a === b || (a !== a && b !== b);
76
+ }
78
77
 
79
78
  var ARGUMENTS_TAG = '[object Arguments]';
80
79
  var BOOLEAN_TAG = '[object Boolean]';
@@ -155,7 +154,7 @@
155
154
  // The exception for value comparison is `Promise`-like contracts. These should be
156
155
  // treated the same as standard `Promise` objects, which means strict equality.
157
156
  return isPromiseLike(a) || isPromiseLike(b)
158
- ? a === b
157
+ ? false
159
158
  : areObjectsEqual(a, b, isEqual, meta);
160
159
  }
161
160
  // As the penultimate fallback, check if the values passed are primitive wrappers. This
@@ -164,18 +163,18 @@
164
163
  if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
165
164
  return sameValueZeroEqual(a.valueOf(), b.valueOf());
166
165
  }
167
- // If not matching any tags that require a specific type of comparison, then use strict
168
- // equality. This is for a few reasons:
169
- // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), this is the only
166
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
167
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
168
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
170
169
  // comparison that can be made.
171
170
  // - For types that can be introspected, but rarely have requirements to be compared
172
171
  // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
173
- // use-cases.
174
- // - For types that can be introspected, but do not have an objective definition of what
175
- // equality is (`Error`, etc.), the subjective decision was to be conservative.
172
+ // use-cases (may be included in a future release, if requested enough).
173
+ // - For types that can be introspected but do not have an objective definition of what
174
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
176
175
  // In all cases, these decisions should be reevaluated based on changes to the language and
177
176
  // common development practices.
178
- return a === b;
177
+ return false;
179
178
  }
180
179
  return comparator;
181
180
  }
@@ -261,14 +260,13 @@
261
260
 
262
261
  var OWNER = '_owner';
263
262
  var hasOwnProperty = Object.prototype.hasOwnProperty;
264
- var getProperties = Object.keys;
265
263
  /**
266
264
  * Whether the objects are equal in value.
267
265
  */
268
266
  function areObjectsEqual(a, b, isEqual, meta) {
269
- var keysA = getProperties(a);
267
+ var keysA = Object.keys(a);
270
268
  var index = keysA.length;
271
- if (getProperties(b).length !== index) {
269
+ if (Object.keys(b).length !== index) {
272
270
  return false;
273
271
  }
274
272
  var key;
@@ -1 +1 @@
1
- {"version":3,"file":"fast-equals.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport const sameValueZeroEqual =\n Object.is ||\n function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (a !== a && b !== b);\n };\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? a === b\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n }\n\n // If not matching any tags that require a specific type of comparison, then use strict\n // equality. This is for a few reasons:\n // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), 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.\n // - For types that can be introspected, but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision was to be conservative.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return a === b;\n }\n\n return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\nconst getProperties = Object.keys;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = getProperties(a);\n\n let index = keysA.length;\n\n if (getProperties(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":";;;;;;EAMA;;;EAGG;EACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;EAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,QAAa,EACb,QAAa,EACb,IAAU,EAAA;UAEV,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;EAChC,KAAC,CAAC;EACJ,CAAC;EAED;;;;EAIG;EACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;MAC5B,OAAO,SAAS,UAAU,CACxB,CAAM,EACN,CAAM,EACN,OAAsD,EACtD,KAAwB,EAAA;EAExB,QAAA,IA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,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;UAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;EAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;EAAtB,KAAsB,EAA8B;EACxD;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"fast-equals.js","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\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 !== a && b !== b);\n}\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? false\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\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 return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = Object.keys(a);\n\n let index = keysA.length;\n\n if (Object.keys(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as E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;;;;;EAOG;EACG,SAAU,iBAAiB,CAC/B,oBAAgD,EAAA;EAEhD,IAAA,OAAO,gBAAgB,CACrB,KAAK,CAAC,cAAc,EAAE,oBAAoB,CAAC,cAAqB,CAAC,CAAC,CACnE,CAAC;EACJ,CAAC;EAED;;;;;;;;;EASG;EACG,SAAU,yBAAyB,CAEvC,oBAAgD,EAAA;EAChD,IAAA,IAAM,UAAU,GAAG,gBAAgB,CACjC,KAAK,CACH,uBAAuB,EACvB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;EAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;UAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;EAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;EAAtB,KAAsB,EAA8B;EACxD;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["fast-equals"]={})}(this,(function(e){"use strict";function r(e){return function(r,t,n,a,u,o,f){return e(r,t,f)}}function t(e){return function(r,t,n,a){if(!r||!t||"object"!=typeof r||"object"!=typeof t)return e(r,t,n,a);var u=a.get(r),o=a.get(t);if(u&&o)return u===t&&o===r;a.set(r,t),a.set(t,r);var f=e(r,t,n,a);return a.delete(r),a.delete(t),f}}function n(e,r){var t={};for(var n in e)t[n]=e[n];for(var n in r)t[n]=r[n];return t}function a(e){return e.constructor===Object||null==e.constructor}function u(e){return"function"==typeof e.then}var o=Object.is||function(e,r){return e===r||e!=e&&r!=r},f=Object.prototype.toString;function c(e){var r=e.areArraysEqual,t=e.areDatesEqual,n=e.areMapsEqual,c=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,s=(0,e.createIsNestedEqual)(E);function E(e,E,p){if(e===E)return!0;if(!e||!E||"object"!=typeof e||"object"!=typeof E)return e!=e&&E!=E;if(a(e)&&a(E))return c(e,E,s,p);var q=Array.isArray(e),v=Array.isArray(E);if(q||v)return q===v&&r(e,E,s,p);var b=f.call(e);return b===f.call(E)&&("[object Date]"===b?t(e,E,s,p):"[object RegExp]"===b?i(e,E,s,p):"[object Map]"===b?n(e,E,s,p):"[object Set]"===b?l(e,E,s,p):"[object Object]"===b||"[object Arguments]"===b?u(e)||u(E)?e===E:c(e,E,s,p):"[object Boolean]"===b||"[object Number]"===b||"[object String]"===b?o(e.valueOf(),E.valueOf()):e===E)}return E}function i(e,r,t,n){var a=e.length;if(r.length!==a)return!1;for(;a-- >0;)if(!t(e[a],r[a],a,a,e,r,n))return!1;return!0}var l=t(i);function s(e,r){return o(e.valueOf(),r.valueOf())}function E(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={},o=0;return e.forEach((function(f,c){if(a){var i=!1,l=0;r.forEach((function(a,s){i||u[l]||!(i=t(c,s,o,l,e,r,n)&&t(f,a,c,s,e,r,n))||(u[l]=!0),l++})),o++,a=i}})),a}var p=t(E),q=Object.prototype.hasOwnProperty,v=Object.keys;function b(e,r,t,n){var a,u=v(e),o=u.length;if(v(r).length!==o)return!1;for(;o-- >0;){if("_owner"===(a=u[o])){var f=!!e.$$typeof,c=!!r.$$typeof;if((f||c)&&f!==c)return!1}if(!q.call(r,a)||!t(e[a],r[a],a,a,e,r,n))return!1}return!0}var j=t(b);function y(e,r){return e.source===r.source&&e.flags===r.flags}function d(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={};return e.forEach((function(o,f){if(a){var c=!1,i=0;r.forEach((function(a,l){c||u[i]||!(c=t(o,a,f,l,e,r,n))||(u[i]=!0),i++})),a=c}})),a}var g=t(d),O=Object.freeze({areArraysEqual:i,areDatesEqual:s,areMapsEqual:E,areObjectsEqual:b,areRegExpsEqual:y,areSetsEqual:d,createIsNestedEqual:r}),h=Object.freeze({areArraysEqual:l,areDatesEqual:s,areMapsEqual:p,areObjectsEqual:j,areRegExpsEqual:y,areSetsEqual:g,createIsNestedEqual:r}),z=c(O),A=c(n(O,{createIsNestedEqual:function(){return o}})),M=c(h),m=c(n(h,{createIsNestedEqual:function(){return o}}));e.circularDeepEqual=function(e,r){return M(e,r,new WeakMap)},e.circularShallowEqual=function(e,r){return m(e,r,new WeakMap)},e.createCustomCircularEqual=function(e){var r=c(n(h,e(h)));return function(e,t,n){return void 0===n&&(n=new WeakMap),r(e,t,n)}},e.createCustomEqual=function(e){return c(n(O,e(O)))},e.deepEqual=function(e,r){return z(e,r,void 0)},e.sameValueZeroEqual=o,e.shallowEqual=function(e,r){return A(e,r,void 0)},Object.defineProperty(e,"__esModule",{value:!0})}));
1
+ !function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self)["fast-equals"]={})}(this,(function(e){"use strict";function r(e){return function(r,t,n,a,u,o,f){return e(r,t,f)}}function t(e){return function(r,t,n,a){if(!r||!t||"object"!=typeof r||"object"!=typeof t)return e(r,t,n,a);var u=a.get(r),o=a.get(t);if(u&&o)return u===t&&o===r;a.set(r,t),a.set(t,r);var f=e(r,t,n,a);return a.delete(r),a.delete(t),f}}function n(e,r){var t={};for(var n in e)t[n]=e[n];for(var n in r)t[n]=r[n];return t}function a(e){return e.constructor===Object||null==e.constructor}function u(e){return"function"==typeof e.then}function o(e,r){return e===r||e!=e&&r!=r}var f=Object.prototype.toString;function c(e){var r=e.areArraysEqual,t=e.areDatesEqual,n=e.areMapsEqual,c=e.areObjectsEqual,i=e.areRegExpsEqual,l=e.areSetsEqual,s=(0,e.createIsNestedEqual)(E);function E(e,E,p){if(e===E)return!0;if(!e||!E||"object"!=typeof e||"object"!=typeof E)return e!=e&&E!=E;if(a(e)&&a(E))return c(e,E,s,p);var q=Array.isArray(e),v=Array.isArray(E);if(q||v)return q===v&&r(e,E,s,p);var b=f.call(e);return b===f.call(E)&&("[object Date]"===b?t(e,E,s,p):"[object RegExp]"===b?i(e,E,s,p):"[object Map]"===b?n(e,E,s,p):"[object Set]"===b?l(e,E,s,p):"[object Object]"===b||"[object Arguments]"===b?!u(e)&&!u(E)&&c(e,E,s,p):("[object Boolean]"===b||"[object Number]"===b||"[object String]"===b)&&o(e.valueOf(),E.valueOf()))}return E}function i(e,r,t,n){var a=e.length;if(r.length!==a)return!1;for(;a-- >0;)if(!t(e[a],r[a],a,a,e,r,n))return!1;return!0}var l=t(i);function s(e,r){return o(e.valueOf(),r.valueOf())}function E(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={},o=0;return e.forEach((function(f,c){if(a){var i=!1,l=0;r.forEach((function(a,s){i||u[l]||!(i=t(c,s,o,l,e,r,n)&&t(f,a,c,s,e,r,n))||(u[l]=!0),l++})),o++,a=i}})),a}var p=t(E),q=Object.prototype.hasOwnProperty;function v(e,r,t,n){var a,u=Object.keys(e),o=u.length;if(Object.keys(r).length!==o)return!1;for(;o-- >0;){if("_owner"===(a=u[o])){var f=!!e.$$typeof,c=!!r.$$typeof;if((f||c)&&f!==c)return!1}if(!q.call(r,a)||!t(e[a],r[a],a,a,e,r,n))return!1}return!0}var b=t(v);function j(e,r){return e.source===r.source&&e.flags===r.flags}function y(e,r,t,n){var a=e.size===r.size;if(!a)return!1;if(!e.size)return!0;var u={};return e.forEach((function(o,f){if(a){var c=!1,i=0;r.forEach((function(a,l){c||u[i]||!(c=t(o,a,f,l,e,r,n))||(u[i]=!0),i++})),a=c}})),a}var d=t(y),g=Object.freeze({areArraysEqual:i,areDatesEqual:s,areMapsEqual:E,areObjectsEqual:v,areRegExpsEqual:j,areSetsEqual:y,createIsNestedEqual:r}),O=Object.freeze({areArraysEqual:l,areDatesEqual:s,areMapsEqual:p,areObjectsEqual:b,areRegExpsEqual:j,areSetsEqual:d,createIsNestedEqual:r}),h=c(g),z=c(n(g,{createIsNestedEqual:function(){return o}})),A=c(O),M=c(n(O,{createIsNestedEqual:function(){return o}}));e.circularDeepEqual=function(e,r){return A(e,r,new WeakMap)},e.circularShallowEqual=function(e,r){return M(e,r,new WeakMap)},e.createCustomCircularEqual=function(e){var r=c(n(O,e(O)));return function(e,t,n){return void 0===n&&(n=new WeakMap),r(e,t,n)}},e.createCustomEqual=function(e){return c(n(g,e(g)))},e.deepEqual=function(e,r){return h(e,r,void 0)},e.sameValueZeroEqual=o,e.shallowEqual=function(e,r){return z(e,r,void 0)},Object.defineProperty(e,"__esModule",{value:!0})}));
@@ -65,10 +65,9 @@ function isPromiseLike(value) {
65
65
  /**
66
66
  * Whether the values passed are strictly equal or both NaN.
67
67
  */
68
- var sameValueZeroEqual = Object.is ||
69
- function sameValueZeroEqual(a, b) {
70
- return a === b || (a !== a && b !== b);
71
- };
68
+ function sameValueZeroEqual(a, b) {
69
+ return a === b || (a !== a && b !== b);
70
+ }
72
71
 
73
72
  var ARGUMENTS_TAG = '[object Arguments]';
74
73
  var BOOLEAN_TAG = '[object Boolean]';
@@ -149,7 +148,7 @@ function createComparator(_a) {
149
148
  // The exception for value comparison is `Promise`-like contracts. These should be
150
149
  // treated the same as standard `Promise` objects, which means strict equality.
151
150
  return isPromiseLike(a) || isPromiseLike(b)
152
- ? a === b
151
+ ? false
153
152
  : areObjectsEqual(a, b, isEqual, meta);
154
153
  }
155
154
  // As the penultimate fallback, check if the values passed are primitive wrappers. This
@@ -158,18 +157,18 @@ function createComparator(_a) {
158
157
  if (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {
159
158
  return sameValueZeroEqual(a.valueOf(), b.valueOf());
160
159
  }
161
- // If not matching any tags that require a specific type of comparison, then use strict
162
- // equality. This is for a few reasons:
163
- // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), this is the only
160
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
161
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
162
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
164
163
  // comparison that can be made.
165
164
  // - For types that can be introspected, but rarely have requirements to be compared
166
165
  // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
167
- // use-cases.
168
- // - For types that can be introspected, but do not have an objective definition of what
169
- // equality is (`Error`, etc.), the subjective decision was to be conservative.
166
+ // use-cases (may be included in a future release, if requested enough).
167
+ // - For types that can be introspected but do not have an objective definition of what
168
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
170
169
  // In all cases, these decisions should be reevaluated based on changes to the language and
171
170
  // common development practices.
172
- return a === b;
171
+ return false;
173
172
  }
174
173
  return comparator;
175
174
  }
@@ -255,14 +254,13 @@ var areMapsEqualCircular = createIsCircular(areMapsEqual);
255
254
 
256
255
  var OWNER = '_owner';
257
256
  var hasOwnProperty = Object.prototype.hasOwnProperty;
258
- var getProperties = Object.keys;
259
257
  /**
260
258
  * Whether the objects are equal in value.
261
259
  */
262
260
  function areObjectsEqual(a, b, isEqual, meta) {
263
- var keysA = getProperties(a);
261
+ var keysA = Object.keys(a);
264
262
  var index = keysA.length;
265
- if (getProperties(b).length !== index) {
263
+ if (Object.keys(b).length !== index) {
266
264
  return false;
267
265
  }
268
266
  var key;
@@ -1 +1 @@
1
- {"version":3,"file":"fast-equals.mjs","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport const sameValueZeroEqual =\n Object.is ||\n function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (a !== a && b !== b);\n };\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? a === b\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n }\n\n // If not matching any tags that require a specific type of comparison, then use strict\n // equality. This is for a few reasons:\n // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), 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.\n // - For types that can be introspected, but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision was to be conservative.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return a === b;\n }\n\n return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\nconst getProperties = Object.keys;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = getProperties(a);\n\n let index = keysA.length;\n\n if (getProperties(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":"AAMA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;AAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,QAAa,EACb,QAAa,EACb,IAAU,EAAA;QAEV,OAAO,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;AAChC,KAAC,CAAC;AACJ,CAAC;AAED;;;;AAIG;AACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;IAC5B,OAAO,SAAS,UAAU,CACxB,CAAM,EACN,CAAM,EACN,OAAsD,EACtD,KAAwB,EAAA;AAExB,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;YAC9D,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;AAC5C,SAA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AAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;"}
1
+ {"version":3,"file":"fast-equals.mjs","sources":["../src/utils.ts","../src/comparator.ts","../src/arrays.ts","../src/dates.ts","../src/maps.ts","../src/objects.ts","../src/regexps.ts","../src/sets.ts","../src/index.ts"],"sourcesContent":["import {\n EqualityComparator,\n InternalEqualityComparator,\n TypeEqualityComparator,\n} from '../index.d';\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createDefaultIsNestedEqual<Meta>(\n comparator: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function isEqual<A, B>(\n a: A,\n b: B,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n meta: Meta,\n ) {\n return comparator(a, b, meta);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular cache, 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 isEqual: InternalEqualityComparator<WeakMap<any, any>>,\n cache: WeakMap<any, any>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, isEqual, cache);\n }\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, isEqual, cache);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Targeted shallow merge of two objects.\n *\n * @NOTE\n * This exists as a tinier compiled version of the `__assign` helper that\n * `tsc` injects in case of `Object.assign` not being present.\n */\nexport function merge<A extends object, B extends object>(a: A, b: B): A & B {\n const merged: Record<string, any> = {};\n\n for (const key in a) {\n merged[key] = a[key];\n }\n\n for (const key in b) {\n merged[key] = b[key];\n }\n\n return merged as A & B;\n}\n\n/**\n * Whether the value is a plain object.\n *\n * @NOTE\n * This is a same-realm compariosn only.\n */\nexport function isPlainObject(value: any): boolean {\n return value.constructor === Object || value.constructor == null;\n}\n\n/**\n * When the value is `Promise`-like, aka \"then-able\".\n */\nexport function isPromiseLike(value: any): boolean {\n return typeof value.then === 'function';\n}\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 !== a && b !== b);\n}\n","import { isPlainObject, isPromiseLike, sameValueZeroEqual } from './utils';\n\nimport type {\n CreateComparatorCreatorOptions,\n EqualityComparator,\n} from '../index.d';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\n\nconst { toString } = Object.prototype;\n\nexport function createComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual,\n}: CreateComparatorCreatorOptions<Meta>): EqualityComparator<Meta> {\n const isEqual = createIsNestedEqual(comparator as EqualityComparator<Meta>);\n\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n function comparator(a: any, b: any, meta: 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 (isPlainObject(a) && isPlainObject(b)) {\n return areObjectsEqual(a, b, isEqual, meta);\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 const aArray = Array.isArray(a);\n const bArray = Array.isArray(b);\n\n if (aArray || bArray) {\n return aArray === bArray && areArraysEqual(a, b, isEqual, meta);\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 aTag = toString.call(a);\n\n if (aTag !== toString.call(b)) {\n return false;\n }\n\n if (aTag === DATE_TAG) {\n // `getTime()` showed better results compared to alternatives like `valueOf()`\n // or the unary `+` operator.\n return areDatesEqual(a, b, isEqual, meta);\n }\n\n if (aTag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === MAP_TAG) {\n return areMapsEqual(a, b, isEqual, meta);\n }\n\n if (aTag === SET_TAG) {\n return areSetsEqual(a, b, isEqual, meta);\n }\n\n // If a simple object tag, then we can prioritize a simple object comparison because\n // it is likely a custom class. If an arguments tag, it should be treated as a standard\n // object.\n if (aTag === OBJECT_TAG || aTag === ARGUMENTS_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.\n return isPromiseLike(a) || isPromiseLike(b)\n ? false\n : areObjectsEqual(a, b, isEqual, meta);\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 (aTag === BOOLEAN_TAG || aTag === NUMBER_TAG || aTag === STRING_TAG) {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\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 return comparator as EqualityComparator<Meta>;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(\n a: any[],\n b: any[],\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let index = a.length;\n\n if (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 (!isEqual(a[index], b[index], index, index, a, b, meta)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the arrays are equal in value, including circular references.\n */\nexport const areArraysEqualCircular = createIsCircular(areArraysEqual);\n","import { sameValueZeroEqual } from './utils';\n\n/**\n * Whether the dates passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\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 isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 isEqual(aKey, bKey, indexA, matchIndexB, a, b, meta) &&\n isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndexB] = true;\n }\n\n matchIndexB++;\n });\n\n indexA++;\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Map`s are equal in value, including circular references.\n */\nexport const areMapsEqualCircular = createIsCircular(areMapsEqual);\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\ninterface Dictionary<Value> {\n [key: string]: Value;\n $$typeof?: any;\n}\n\nconst OWNER = '_owner';\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary<any>,\n b: Dictionary<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n const keysA = Object.keys(a);\n\n let index = keysA.length;\n\n if (Object.keys(b).length !== index) {\n return false;\n }\n\n let key: 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 key = keysA[index];\n\n if (key === OWNER) {\n const reactElementA = !!a.$$typeof;\n const reactElementB = !!b.$$typeof;\n\n if ((reactElementA || reactElementB) && reactElementA !== reactElementB) {\n return false;\n }\n }\n\n if (\n !hasOwnProperty.call(b, key) ||\n !isEqual(a[key], b[key], key, key, a, b, meta)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value, including circular references.\n */\nexport const areObjectsEqualCircular = createIsCircular(areObjectsEqual);\n","/**\n * Whether the regexps passed are equal in value.\n *\n * @NOTE\n * This is a standalone function instead of done inline in the comparator\n * to allow for overrides. An example of this would be supporting a\n * pre-ES2015 environment where the `flags` property is not available.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n","import { createIsCircular } from './utils';\n\nimport type { InternalEqualityComparator } from '../index.d';\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n isEqual: InternalEqualityComparator<any>,\n meta: any,\n): boolean {\n let isValueEqual = a.size === b.size;\n\n if (!isValueEqual) {\n return false;\n }\n\n if (!a.size) {\n return true;\n }\n\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 = isEqual(aValue, bValue, aKey, bKey, a, b, meta))\n ) {\n matchedIndices[matchIndex] = true;\n }\n\n matchIndex++;\n });\n\n isValueEqual = hasMatch;\n });\n\n return isValueEqual;\n}\n\n/**\n * Whether the `Set`s are equal in value, including circular references.\n */\nexport const areSetsEqualCircular = createIsCircular(areSetsEqual);\n","import { createComparator } from './comparator';\nimport { areArraysEqual, areArraysEqualCircular } from './arrays';\nimport { areDatesEqual } from './dates';\nimport { areMapsEqual, areMapsEqualCircular } from './maps';\nimport { areObjectsEqual, areObjectsEqualCircular } from './objects';\nimport { areRegExpsEqual } from './regexps';\nimport { areSetsEqual, areSetsEqualCircular } from './sets';\nimport { createDefaultIsNestedEqual, merge, sameValueZeroEqual } from './utils';\n\nimport type {\n BaseCircularMeta,\n CreateComparatorCreatorOptions,\n EqualityComparator,\n GetComparatorOptions,\n} from '../index.d';\n\nexport { sameValueZeroEqual };\n\nconst DEFAULT_CONFIG: CreateComparatorCreatorOptions<undefined> = Object.freeze(\n {\n areArraysEqual,\n areDatesEqual,\n areMapsEqual,\n areObjectsEqual,\n areRegExpsEqual,\n areSetsEqual,\n createIsNestedEqual: createDefaultIsNestedEqual,\n },\n);\nconst DEFAULT_CIRCULAR_CONFIG: CreateComparatorCreatorOptions<BaseCircularMeta> =\n Object.freeze({\n areArraysEqual: areArraysEqualCircular,\n areDatesEqual,\n areMapsEqual: areMapsEqualCircular,\n areObjectsEqual: areObjectsEqualCircular,\n areRegExpsEqual,\n areSetsEqual: areSetsEqualCircular,\n createIsNestedEqual: createDefaultIsNestedEqual,\n });\n\nconst isDeepEqual = createComparator(DEFAULT_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport function deepEqual<A, B>(a: A, b: B): boolean {\n return isDeepEqual(a, b, undefined);\n}\n\nconst isShallowEqual = createComparator(\n merge(DEFAULT_CONFIG, { createIsNestedEqual: () => sameValueZeroEqual }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport function shallowEqual<A, B>(a: A, b: B): boolean {\n return isShallowEqual(a, b, undefined);\n}\n\nconst isCircularDeepEqual = createComparator(DEFAULT_CIRCULAR_CONFIG);\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport function circularDeepEqual<A, B>(a: A, b: B): boolean {\n return isCircularDeepEqual(a, b, new WeakMap());\n}\n\nconst isCircularShallowEqual = createComparator(\n merge(DEFAULT_CIRCULAR_CONFIG, {\n createIsNestedEqual: () => sameValueZeroEqual,\n }),\n);\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport function circularShallowEqual<A, B>(a: A, b: B): boolean {\n return isCircularShallowEqual(a, b, new WeakMap());\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 getComparatorOptions: GetComparatorOptions<Meta>,\n): EqualityComparator<Meta> {\n return createComparator<Meta>(\n merge(DEFAULT_CONFIG, getComparatorOptions(DEFAULT_CONFIG as any)),\n );\n}\n\n/**\n * Create a custom equality comparison method that handles circular references. This is very\n * similar to `createCustomEqual`, with the only difference being that `meta` expects to be\n * populated with a `WeakMap`-like contract.\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 * `WeakMap` out of the box.\n */\nexport function createCustomCircularEqual<\n Meta extends BaseCircularMeta = WeakMap<any, any>,\n>(getComparatorOptions: GetComparatorOptions<Meta>): EqualityComparator<Meta> {\n const comparator = createComparator<Meta>(\n merge(\n DEFAULT_CIRCULAR_CONFIG,\n getComparatorOptions(DEFAULT_CIRCULAR_CONFIG as any),\n ),\n );\n\n return ((a: any, b: any, meta: any = new WeakMap()) =>\n comparator(a, b, meta)) as EqualityComparator<Meta>;\n}\n"],"names":[],"mappings":"AAMA;;;AAGG;AACG,SAAU,0BAA0B,CACxC,UAAoC,EAAA;AAEpC,IAAA,OAAO,SAAS,OAAO,CACrB,CAAI,EACJ,CAAI,EACJ,YAAiB,EACjB,YAAiB,EACjB,QAAa,EACb,QAAa,EACb,IAAU,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vC,oBAAgD,EAAA;AAChD,IAAA,IAAM,UAAU,GAAG,gBAAgB,CACjC,KAAK,CACH,uBAAuB,EACvB,oBAAoB,CAAC,uBAA8B,CAAC,CACrD,CACF,CAAC;AAEF,IAAA,QAAQ,UAAC,CAAM,EAAE,CAAM,EAAE,IAAyB,EAAA;QAAzB,IAAA,IAAA,KAAA,KAAA,CAAA,EAAA,EAAA,IAAgB,GAAA,IAAA,OAAO,EAAE,CAAA,EAAA;AAChD,QAAA,OAAA,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,CAAC,CAAA;AAAtB,KAAsB,EAA8B;AACxD;;;;"}
package/package.json CHANGED
@@ -7,47 +7,47 @@
7
7
  "description": "A blazing fast equality comparison, either shallow or deep",
8
8
  "devDependencies": {
9
9
  "@rollup/plugin-node-resolve": "^13.1.3",
10
- "@types/jest": "^28.1.1",
11
- "@types/lodash": "^4.14.178",
12
- "@types/node": "^17.0.40",
13
- "@types/ramda": "^0.28.13",
14
- "@types/react": "^18.0.11",
15
- "@typescript-eslint/eslint-plugin": "^5.27.0",
16
- "@typescript-eslint/parser": "^5.27.0",
10
+ "@types/jest": "^28.1.8",
11
+ "@types/lodash": "^4.14.184",
12
+ "@types/node": "^18.7.13",
13
+ "@types/ramda": "^0.28.15",
14
+ "@types/react": "^18.0.17",
15
+ "@typescript-eslint/eslint-plugin": "^5.35.1",
16
+ "@typescript-eslint/parser": "^5.35.1",
17
17
  "benchee": "^1.1.0",
18
18
  "cli-table3": "^0.6.1",
19
19
  "decircularize": "^1.0.0",
20
- "deep-eql": "^4.0.0",
20
+ "deep-eql": "^4.1.0",
21
21
  "deep-equal": "^2.0.5",
22
- "eslint": "^8.17.0",
22
+ "eslint": "^8.22.0",
23
23
  "eslint-config-airbnb": "^19.0.4",
24
24
  "eslint-plugin-import": "^2.25.4",
25
- "eslint-plugin-jsx-a11y": "^6.5.1",
26
- "eslint-plugin-react": "^7.28.0",
27
- "eslint-webpack-plugin": "^3.1.1",
25
+ "eslint-plugin-jsx-a11y": "^6.6.1",
26
+ "eslint-plugin-react": "^7.31.0",
27
+ "eslint-webpack-plugin": "^3.2.0",
28
28
  "fast-deep-equal": "^3.1.3",
29
29
  "fs-extra": "^10.0.0",
30
30
  "html-webpack-plugin": "^5.5.0",
31
31
  "in-publish": "^2.0.0",
32
- "jest": "^28.1.0",
32
+ "jest": "^28.1.3",
33
33
  "lodash": "^4.17.21",
34
34
  "nano-equal": "^2.0.2",
35
- "prettier": "^2.6.2",
36
- "react": "^18.1.0",
37
- "react-dom": "^18.1.0",
35
+ "prettier": "^2.7.1",
36
+ "react": "^18.2.0",
37
+ "react-dom": "^18.2.0",
38
38
  "react-fast-compare": "^3.2.0",
39
- "release-it": "^15.0.0",
40
- "rollup": "^2.75.5",
39
+ "release-it": "^15.4.0",
40
+ "rollup": "^2.78.1",
41
41
  "rollup-plugin-terser": "^7.0.2",
42
- "rollup-plugin-typescript2": "^0.32.0",
42
+ "rollup-plugin-typescript2": "^0.33.0",
43
43
  "shallow-equal-fuzzy": "^0.0.2",
44
- "ts-jest": "^28.0.4",
45
- "ts-loader": "^9.2.6",
46
- "typescript": "^4.7.3",
44
+ "ts-jest": "^28.0.8",
45
+ "ts-loader": "^9.3.1",
46
+ "typescript": "^4.7.4",
47
47
  "underscore": "^1.13.4",
48
- "webpack": "^5.73.0",
49
- "webpack-cli": "^4.9.2",
50
- "webpack-dev-server": "^4.9.1"
48
+ "webpack": "^5.74.0",
49
+ "webpack-cli": "^4.10.0",
50
+ "webpack-dev-server": "^4.10.0"
51
51
  },
52
52
  "homepage": "https://github.com/planttheidea/fast-equals#readme",
53
53
  "keywords": [
@@ -85,5 +85,5 @@
85
85
  },
86
86
  "sideEffects": false,
87
87
  "types": "index.d.ts",
88
- "version": "4.0.2"
88
+ "version": "4.0.3"
89
89
  }
package/src/comparator.ts CHANGED
@@ -106,7 +106,7 @@ export function createComparator<Meta>({
106
106
  // The exception for value comparison is `Promise`-like contracts. These should be
107
107
  // treated the same as standard `Promise` objects, which means strict equality.
108
108
  return isPromiseLike(a) || isPromiseLike(b)
109
- ? a === b
109
+ ? false
110
110
  : areObjectsEqual(a, b, isEqual, meta);
111
111
  }
112
112
 
@@ -117,18 +117,18 @@ export function createComparator<Meta>({
117
117
  return sameValueZeroEqual(a.valueOf(), b.valueOf());
118
118
  }
119
119
 
120
- // If not matching any tags that require a specific type of comparison, then use strict
121
- // equality. This is for a few reasons:
122
- // - For types that cannot be introspected (`Promise`, `WeakMap`, etc.), this is the only
120
+ // If not matching any tags that require a specific type of comparison, then we hard-code false because
121
+ // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:
122
+ // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only
123
123
  // comparison that can be made.
124
124
  // - For types that can be introspected, but rarely have requirements to be compared
125
125
  // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common
126
- // use-cases.
127
- // - For types that can be introspected, but do not have an objective definition of what
128
- // equality is (`Error`, etc.), the subjective decision was to be conservative.
126
+ // use-cases (may be included in a future release, if requested enough).
127
+ // - For types that can be introspected but do not have an objective definition of what
128
+ // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.
129
129
  // In all cases, these decisions should be reevaluated based on changes to the language and
130
130
  // common development practices.
131
- return a === b;
131
+ return false;
132
132
  }
133
133
 
134
134
  return comparator as EqualityComparator<Meta>;