fast-equals 5.1.3 → 5.2.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/cjs/index.cjs +15 -19
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.mjs +15 -19
- package/dist/esm/index.mjs.map +1 -1
- package/dist/min/index.js +1 -1
- package/dist/umd/index.js +15 -19
- package/dist/umd/index.js.map +1 -1
- package/index.d.ts +203 -21
- package/package.json +3 -2
- package/scripts/fallback-types.mjs +64 -0
- package/src/equals.ts +26 -32
package/dist/umd/index.js
CHANGED
|
@@ -59,7 +59,9 @@
|
|
|
59
59
|
return a === b || (!a && !b && a !== a && b !== b);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
var
|
|
62
|
+
var PREACT_VNODE = '__v';
|
|
63
|
+
var PREACT_OWNER = '__o';
|
|
64
|
+
var REACT_OWNER = '_owner';
|
|
63
65
|
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
|
|
64
66
|
/**
|
|
65
67
|
* Whether the arrays are equal in value.
|
|
@@ -157,20 +159,12 @@
|
|
|
157
159
|
if (keys(b).length !== index) {
|
|
158
160
|
return false;
|
|
159
161
|
}
|
|
160
|
-
var property;
|
|
161
162
|
// Decrementing `while` showed faster results than either incrementing or
|
|
162
163
|
// decrementing `for` loop and than an incrementing `while` loop. Declarative
|
|
163
164
|
// methods like `some` / `every` were not used to avoid incurring the garbage
|
|
164
165
|
// cost of anonymous callbacks.
|
|
165
166
|
while (index-- > 0) {
|
|
166
|
-
|
|
167
|
-
if (property === OWNER &&
|
|
168
|
-
(a.$$typeof || b.$$typeof) &&
|
|
169
|
-
a.$$typeof !== b.$$typeof) {
|
|
170
|
-
return false;
|
|
171
|
-
}
|
|
172
|
-
if (!hasOwn(b, property) ||
|
|
173
|
-
!state.equals(a[property], b[property], property, property, a, b, state)) {
|
|
167
|
+
if (!isPropertyEqual(a, b, state, properties[index])) {
|
|
174
168
|
return false;
|
|
175
169
|
}
|
|
176
170
|
}
|
|
@@ -194,15 +188,7 @@
|
|
|
194
188
|
// cost of anonymous callbacks.
|
|
195
189
|
while (index-- > 0) {
|
|
196
190
|
property = properties[index];
|
|
197
|
-
if (
|
|
198
|
-
(a.$$typeof || b.$$typeof) &&
|
|
199
|
-
a.$$typeof !== b.$$typeof) {
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
if (!hasOwn(b, property)) {
|
|
203
|
-
return false;
|
|
204
|
-
}
|
|
205
|
-
if (!state.equals(a[property], b[property], property, property, a, b, state)) {
|
|
191
|
+
if (!isPropertyEqual(a, b, state, property)) {
|
|
206
192
|
return false;
|
|
207
193
|
}
|
|
208
194
|
descriptorA = getOwnPropertyDescriptor(a, property);
|
|
@@ -296,6 +282,16 @@
|
|
|
296
282
|
a.username === b.username &&
|
|
297
283
|
a.password === b.password);
|
|
298
284
|
}
|
|
285
|
+
function isPropertyEqual(a, b, state, property) {
|
|
286
|
+
if ((property === REACT_OWNER ||
|
|
287
|
+
property === PREACT_OWNER ||
|
|
288
|
+
property === PREACT_VNODE) &&
|
|
289
|
+
(a.$$typeof || b.$$typeof)) {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
return (hasOwn(b, property) &&
|
|
293
|
+
state.equals(a[property], b[property], property, property, a, b, state));
|
|
294
|
+
}
|
|
299
295
|
|
|
300
296
|
var ARGUMENTS_TAG = '[object Arguments]';
|
|
301
297
|
var BOOLEAN_TAG = '[object Boolean]';
|
package/dist/umd/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../src/utils.ts","../../src/equals.ts","../../src/comparator.ts","../../src/index.ts"],"sourcesContent":["import type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<\n AreItemsEqual extends TypeEqualityComparator<any, any>,\n>(areItemsEqual: AreItemsEqual): AreItemsEqual {\n return function isCircular(\n a: any,\n b: any,\n state: CircularState<Cache<any, any>>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(\n object: Dictionary,\n): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(\n getOwnPropertySymbols(object),\n );\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n Object.hasOwn ||\n ((object: Dictionary, property: number | string | symbol) =>\n hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils';\nimport type {\n Dictionary,\n PrimitiveWrapper,\n State,\n TypedArray,\n} from './internalTypes';\n\nconst OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return (\n a.name === b.name &&\n a.message === b.message &&\n a.cause === b.cause &&\n a.stack === b.stack\n );\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(\n a: (...args: any[]) => any,\n b: (...args: any[]) => any,\n): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n state: State<any>,\n): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices: Array<true | undefined> = new Array(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) &&\n state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n let property: string;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (\n property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (\n !hasOwn(b, property) ||\n !state.equals(a[property], b[property], property, property, a, b, state)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (\n property === OWNER &&\n (a.$$typeof || b.$$typeof) &&\n a.$$typeof !== b.$$typeof\n ) {\n return false;\n }\n\n if (!hasOwn(b, property)) {\n return false;\n }\n\n if (\n !state.equals(a[property], b[property], property, property, a, b, state)\n ) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB) &&\n (!descriptorA ||\n !descriptorB ||\n descriptorA.configurable !== descriptorB.configurable ||\n descriptorA.enumerable !== descriptorB.enumerable ||\n descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(\n a: PrimitiveWrapper,\n b: PrimitiveWrapper,\n): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n state: State<any>,\n): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices: Array<true | undefined> = new Array(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex] &&\n state.equals(\n aResult.value,\n bResult.value,\n aResult.value,\n bResult.value,\n a,\n b,\n state,\n )\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname &&\n a.pathname === b.pathname &&\n a.protocol === b.protocol &&\n a.port === b.port &&\n a.hash === b.hash &&\n a.username === b.username &&\n a.password === b.password\n );\n}\n","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals';\nimport { combineComparators, createIsCircular } from './utils';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst URL_TAG = '[object URL]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nconst { assign } = Object;\nconst getTag = Object.prototype.toString.call.bind(\n Object.prototype.toString,\n) as (a: object) => string;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return (\n typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state)\n );\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict\n ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault)\n : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict\n ? areObjectsEqualStrictDefault\n : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict\n ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault)\n : areSetsEqualDefault,\n areTypedArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({\n circular,\n comparator,\n createState,\n equals,\n strict,\n}: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } =\n createState!();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator';\nimport type { CustomEqualCreatorOptions } from './internalTypes';\nimport { sameValueZeroEqual } from './utils';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(\n options: CustomEqualCreatorOptions<Meta> = {},\n) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault","areArraysEqual","areMapsEqual","areObjectsEqual","areSetsEqual"],"mappings":";;;;;;IASQ,IAAA,mBAAmB,GAA4B,MAAM,CAAA,mBAAlC,EAAE,qBAAqB,GAAK,MAAM,CAAA,qBAAX,CAAY;IACtD,IAAA,cAAc,GAAK,MAAM,CAAC,SAAS,eAArB,CAAsB;IAE5C;;IAEG;IACa,SAAA,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;IAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;IAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,KAAC,CAAC;IACJ,CAAC;IAED;;;;IAIG;IACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;IAC5B,IAAA,OAAO,SAAS,UAAU,CACxB,CAAM,EACN,CAAM,EACN,KAAqC,EAAA;IAErC,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBAC9D,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACnC,SAAA;IAEO,QAAA,IAAA,KAAK,GAAK,KAAK,CAAA,KAAV,CAAW;YAExB,IAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC7B,IAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAE7B,IAAI,OAAO,IAAI,OAAO,EAAE;IACtB,YAAA,OAAO,OAAO,KAAK,CAAC,IAAI,OAAO,KAAK,CAAC,CAAC;IACvC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|
+
{"version":3,"file":"index.js","sources":["../../src/utils.ts","../../src/equals.ts","../../src/comparator.ts","../../src/index.ts"],"sourcesContent":["import type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n Dictionary,\n State,\n TypeEqualityComparator,\n} from './internalTypes';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<\n AreItemsEqual extends TypeEqualityComparator<any, any>,\n>(areItemsEqual: AreItemsEqual): AreItemsEqual {\n return function isCircular(\n a: any,\n b: any,\n state: CircularState<Cache<any, any>>,\n ) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(\n object: Dictionary,\n): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(\n getOwnPropertySymbols(object),\n );\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n Object.hasOwn ||\n ((object: Dictionary, property: number | string | symbol) =>\n hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils';\nimport type {\n Dictionary,\n PrimitiveWrapper,\n State,\n TypedArray,\n} from './internalTypes';\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return (\n a.name === b.name &&\n a.message === b.message &&\n a.cause === b.cause &&\n a.stack === b.stack\n );\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(\n a: (...args: any[]) => any,\n b: (...args: any[]) => any,\n): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(\n a: Map<any, any>,\n b: Map<any, any>,\n state: State<any>,\n): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices: Array<true | undefined> = new Array(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) &&\n state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index]!)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB) &&\n (!descriptorA ||\n !descriptorB ||\n descriptorA.configurable !== descriptorB.configurable ||\n descriptorA.enumerable !== descriptorB.enumerable ||\n descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(\n a: PrimitiveWrapper,\n b: PrimitiveWrapper,\n): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(\n a: Set<any>,\n b: Set<any>,\n state: State<any>,\n): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices: Array<true | undefined> = new Array(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex] &&\n state.equals(\n aResult.value,\n bResult.value,\n aResult.value,\n bResult.value,\n a,\n b,\n state,\n )\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname &&\n a.pathname === b.pathname &&\n a.protocol === b.protocol &&\n a.port === b.port &&\n a.hash === b.hash &&\n a.username === b.username &&\n a.password === b.password\n );\n}\n\nfunction isPropertyEqual(\n a: Dictionary,\n b: Dictionary,\n state: State<any>,\n property: string | symbol,\n) {\n if (\n (property === REACT_OWNER ||\n property === PREACT_OWNER ||\n property === PREACT_VNODE) &&\n (a.$$typeof || b.$$typeof)\n ) {\n return true;\n }\n\n return (\n hasOwn(b, property) &&\n state.equals(a[property], b[property], property, property, a, b, state)\n );\n}\n","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals';\nimport { combineComparators, createIsCircular } from './utils';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst URL_TAG = '[object URL]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n typeof ArrayBuffer === 'function' && ArrayBuffer.isView\n ? ArrayBuffer.isView\n : null;\nconst { assign } = Object;\nconst getTag = Object.prototype.toString.call.bind(\n Object.prototype.toString,\n) as (a: object) => string;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return (\n typeof a.then !== 'function' &&\n typeof b.then !== 'function' &&\n areObjectsEqual(a, b, state)\n );\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict\n ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault)\n : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict\n ? areObjectsEqualStrictDefault\n : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict\n ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault)\n : areSetsEqualDefault,\n areTypedArraysEqual: strict\n ? areObjectsEqualStrictDefault\n : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({\n circular,\n comparator,\n createState,\n equals,\n strict,\n}: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } =\n createState!();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator';\nimport type { CustomEqualCreatorOptions } from './internalTypes';\nimport { sameValueZeroEqual } from './utils';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(\n options: CustomEqualCreatorOptions<Meta> = {},\n) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault","areArraysEqual","areMapsEqual","areObjectsEqual","areSetsEqual"],"mappings":";;;;;;IASQ,IAAA,mBAAmB,GAA4B,MAAM,CAAA,mBAAlC,EAAE,qBAAqB,GAAK,MAAM,CAAA,qBAAX,CAAY;IACtD,IAAA,cAAc,GAAK,MAAM,CAAC,SAAS,eAArB,CAAsB;IAE5C;;IAEG;IACa,SAAA,kBAAkB,CAChC,WAAwC,EACxC,WAAwC,EAAA;IAExC,IAAA,OAAO,SAAS,OAAO,CAAO,CAAI,EAAE,CAAI,EAAE,KAAkB,EAAA;IAC1D,QAAA,OAAO,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,IAAI,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IAC9D,KAAC,CAAC;IACJ,CAAC;IAED;;;;IAIG;IACG,SAAU,gBAAgB,CAE9B,aAA4B,EAAA;IAC5B,IAAA,OAAO,SAAS,UAAU,CACxB,CAAM,EACN,CAAM,EACN,KAAqC,EAAA;IAErC,QAAA,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE;gBAC9D,OAAO,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;IACnC,SAAA;IAEO,QAAA,IAAA,KAAK,GAAK,KAAK,CAAA,KAAV,CAAW;YAExB,IAAM,OAA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
|
package/index.d.ts
CHANGED
|
@@ -1,23 +1,205 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Cache used to store references to objects, used for circular
|
|
3
|
+
* reference checks.
|
|
4
|
+
*/
|
|
5
|
+
export interface Cache<Key extends object, Value> {
|
|
6
|
+
delete(key: Key): boolean;
|
|
7
|
+
get(key: Key): Value | undefined;
|
|
8
|
+
set(key: Key, value: any): any;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface State<Meta> {
|
|
12
|
+
/**
|
|
13
|
+
* Cache used to identify circular references
|
|
14
|
+
*/
|
|
15
|
+
readonly cache: Cache<any, any> | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* Method used to determine equality of nested value.
|
|
18
|
+
*/
|
|
19
|
+
readonly equals: InternalEqualityComparator<Meta>;
|
|
20
|
+
/**
|
|
21
|
+
* Additional value that can be used for comparisons.
|
|
22
|
+
*/
|
|
23
|
+
meta: Meta;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the equality comparison is strict, meaning it matches
|
|
26
|
+
* all properties (including symbols and non-enumerable properties)
|
|
27
|
+
* with equal shape of descriptors.
|
|
28
|
+
*/
|
|
29
|
+
readonly strict: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface CircularState<Meta> extends State<Meta> {
|
|
33
|
+
readonly cache: Cache<any, any>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface DefaultState<Meta> extends State<Meta> {
|
|
37
|
+
readonly cache: undefined;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface Dictionary<Value = any> {
|
|
41
|
+
[key: string | symbol]: Value;
|
|
42
|
+
$$typeof?: any;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface ComparatorConfig<Meta> {
|
|
46
|
+
/**
|
|
47
|
+
* Whether the arrays passed are equal in value. In strict mode, this includes
|
|
48
|
+
* additional properties added to the array.
|
|
49
|
+
*/
|
|
50
|
+
areArraysEqual: TypeEqualityComparator<any, Meta>;
|
|
51
|
+
/**
|
|
52
|
+
* Whether the dates passed are equal in value.
|
|
53
|
+
*/
|
|
54
|
+
areDatesEqual: TypeEqualityComparator<any, Meta>;
|
|
55
|
+
/**
|
|
56
|
+
* Whether the errors passed are equal in value.
|
|
57
|
+
*/
|
|
58
|
+
areErrorsEqual: TypeEqualityComparator<any, Meta>;
|
|
59
|
+
/**
|
|
60
|
+
* Whether the functions passed are equal in value.
|
|
61
|
+
*/
|
|
62
|
+
areFunctionsEqual: TypeEqualityComparator<any, Meta>;
|
|
63
|
+
/**
|
|
64
|
+
* Whether the maps passed are equal in value. In strict mode, this includes
|
|
65
|
+
* additional properties added to the map.
|
|
66
|
+
*/
|
|
67
|
+
areMapsEqual: TypeEqualityComparator<any, Meta>;
|
|
68
|
+
/**
|
|
69
|
+
* Whether the numbers passed are equal in value.
|
|
70
|
+
*/
|
|
71
|
+
areNumbersEqual: TypeEqualityComparator<any, Meta>;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the objects passed are equal in value. In strict mode, this includes
|
|
74
|
+
* non-enumerable properties added to the map, as well as symbol properties.
|
|
75
|
+
*/
|
|
76
|
+
areObjectsEqual: TypeEqualityComparator<any, Meta>;
|
|
77
|
+
/**
|
|
78
|
+
* Whether the primitive wrappers passed are equal in value.
|
|
79
|
+
*/
|
|
80
|
+
arePrimitiveWrappersEqual: TypeEqualityComparator<any, Meta>;
|
|
81
|
+
/**
|
|
82
|
+
* Whether the regexps passed are equal in value.
|
|
83
|
+
*/
|
|
84
|
+
areRegExpsEqual: TypeEqualityComparator<any, Meta>;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the sets passed are equal in value. In strict mode, this includes
|
|
87
|
+
* additional properties added to the set.
|
|
88
|
+
*/
|
|
89
|
+
areSetsEqual: TypeEqualityComparator<any, Meta>;
|
|
90
|
+
/**
|
|
91
|
+
* Whether the typed arrays passed are equal in value. In strict mode, this includes
|
|
92
|
+
* additional properties added to the typed array.
|
|
93
|
+
*/
|
|
94
|
+
areTypedArraysEqual: TypeEqualityComparator<any, Meta>;
|
|
95
|
+
/**
|
|
96
|
+
* Whether the URLs passed are equal in value.
|
|
97
|
+
*/
|
|
98
|
+
areUrlsEqual: TypeEqualityComparator<any, Meta>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export type CreateCustomComparatorConfig<Meta> = (
|
|
102
|
+
config: ComparatorConfig<Meta>,
|
|
103
|
+
) => Partial<ComparatorConfig<Meta>>;
|
|
104
|
+
|
|
105
|
+
export type CreateState<Meta> = () => {
|
|
106
|
+
cache?: Cache<any, any> | undefined;
|
|
107
|
+
meta?: Meta;
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export type EqualityComparator<Meta> = <A, B>(
|
|
111
|
+
a: A,
|
|
112
|
+
b: B,
|
|
113
|
+
state: State<Meta>,
|
|
114
|
+
) => boolean;
|
|
115
|
+
export type AnyEqualityComparator<Meta> = (
|
|
116
|
+
a: any,
|
|
117
|
+
b: any,
|
|
118
|
+
state: State<Meta>,
|
|
119
|
+
) => boolean;
|
|
120
|
+
|
|
121
|
+
export type EqualityComparatorCreator<Meta> = (
|
|
122
|
+
fn: EqualityComparator<Meta>,
|
|
123
|
+
) => InternalEqualityComparator<Meta>;
|
|
124
|
+
|
|
125
|
+
export type InternalEqualityComparator<Meta> = (
|
|
126
|
+
a: any,
|
|
127
|
+
b: any,
|
|
128
|
+
indexOrKeyA: any,
|
|
129
|
+
indexOrKeyB: any,
|
|
130
|
+
parentA: any,
|
|
131
|
+
parentB: any,
|
|
132
|
+
state: State<Meta>,
|
|
133
|
+
) => boolean;
|
|
134
|
+
|
|
135
|
+
// We explicitly check for primitive wrapper types
|
|
136
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
137
|
+
export type PrimitiveWrapper = Boolean | Number | String;
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Type which encompasses possible instances of TypedArray
|
|
141
|
+
* classes.
|
|
142
|
+
*
|
|
143
|
+
* **NOTE**: This does not include `BigInt64Array` and
|
|
144
|
+
* `BitUint64Array` because those are part of ES2020 and
|
|
145
|
+
* not supported by certain TS configurations. If using
|
|
146
|
+
* either in `areTypedArraysEqual`, you can cast the
|
|
147
|
+
* instance as `TypedArray` and it will work as expected,
|
|
148
|
+
* because runtime checks will still work for those classes.
|
|
149
|
+
*/
|
|
150
|
+
export type TypedArray =
|
|
151
|
+
| Float32Array
|
|
152
|
+
| Float64Array
|
|
153
|
+
| Int8Array
|
|
154
|
+
| Int16Array
|
|
155
|
+
| Int32Array
|
|
156
|
+
| Uint16Array
|
|
157
|
+
| Uint32Array
|
|
158
|
+
| Uint8Array
|
|
159
|
+
| Uint8ClampedArray;
|
|
160
|
+
|
|
161
|
+
export type TypeEqualityComparator<Type, Meta = undefined> = (
|
|
162
|
+
a: Type,
|
|
163
|
+
b: Type,
|
|
164
|
+
state: State<Meta>,
|
|
165
|
+
) => boolean;
|
|
166
|
+
|
|
167
|
+
export interface CustomEqualCreatorOptions<Meta> {
|
|
168
|
+
/**
|
|
169
|
+
* Whether circular references should be supported. It causes the
|
|
170
|
+
* comparison to be slower, but for objects that have circular references
|
|
171
|
+
* it is required to avoid stack overflows.
|
|
172
|
+
*/
|
|
173
|
+
circular?: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Create a custom configuration of type-specific equality comparators.
|
|
176
|
+
* This receives the default configuration, which allows either replacement
|
|
177
|
+
* or supersetting of the default methods.
|
|
178
|
+
*/
|
|
179
|
+
createCustomConfig?: CreateCustomComparatorConfig<Meta>;
|
|
180
|
+
/**
|
|
181
|
+
* Create a custom internal comparator, which is used as an override to the
|
|
182
|
+
* default entry point for nested value equality comparisons. This is often
|
|
183
|
+
* used for doing custom logic for specific types (such as handling a specific
|
|
184
|
+
* class instance differently than other objects) or to incorporate `meta` in
|
|
185
|
+
* the comparison. See the recipes for examples.
|
|
186
|
+
*/
|
|
187
|
+
createInternalComparator?: (
|
|
188
|
+
compare: EqualityComparator<Meta>,
|
|
189
|
+
) => InternalEqualityComparator<Meta>;
|
|
190
|
+
/**
|
|
191
|
+
* Create a custom `state` object passed between the methods. This allows for
|
|
192
|
+
* custom `cache` and/or `meta` values to be used.
|
|
193
|
+
*/
|
|
194
|
+
createState?: CreateState<Meta>;
|
|
195
|
+
/**
|
|
196
|
+
* Whether the equality comparison is strict, meaning it matches
|
|
197
|
+
* all properties (including symbols and non-enumerable properties)
|
|
198
|
+
* with equal shape of descriptors.
|
|
199
|
+
*/
|
|
200
|
+
strict?: boolean;
|
|
201
|
+
}
|
|
202
|
+
|
|
21
203
|
|
|
22
204
|
/**
|
|
23
205
|
* Whether the values passed are strictly equal or both NaN.
|
|
@@ -68,4 +250,4 @@ export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
|
68
250
|
*/
|
|
69
251
|
export declare function createCustomEqual<Meta = undefined>(
|
|
70
252
|
options?: CustomEqualCreatorOptions<Meta>,
|
|
71
|
-
): <A, B>(a: A, b: B) => boolean;
|
|
253
|
+
): <A, B>(a: A, b: B) => boolean;
|
package/package.json
CHANGED
|
@@ -87,10 +87,11 @@
|
|
|
87
87
|
},
|
|
88
88
|
"scripts": {
|
|
89
89
|
"benchmark": "npm run build:esm && node benchmark/index.js",
|
|
90
|
-
"build": "npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:min",
|
|
90
|
+
"build": "npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:min && npm run build:types",
|
|
91
91
|
"build:cjs": "rm -rf dist/cjs && NODE_ENV=production rollup -c config/rollup/config.cjs.js && tsc -p ./config/tsconfig/cjs.json",
|
|
92
92
|
"build:esm": "rm -rf dist/esm && NODE_ENV=production rollup -c config/rollup/config.esm.js && tsc -p ./config/tsconfig/esm.json",
|
|
93
93
|
"build:min": "rm -rf dist/min && NODE_ENV=production rollup -c config/rollup/config.min.js && tsc -p ./config/tsconfig/min.json",
|
|
94
|
+
"build:types": "node scripts/fallback-types.mjs",
|
|
94
95
|
"build:umd": "rm -rf dist/umd && NODE_ENV=production rollup -c config/rollup/config.umd.js && tsc -p ./config/tsconfig/umd.json",
|
|
95
96
|
"dev": "NODE_ENV=development webpack serve --progress --config=config/webpack.config.js",
|
|
96
97
|
"format": "prettier **/*.ts --write",
|
|
@@ -108,5 +109,5 @@
|
|
|
108
109
|
"sideEffects": false,
|
|
109
110
|
"type": "module",
|
|
110
111
|
"types": "./index.d.ts",
|
|
111
|
-
"version": "5.1.
|
|
112
|
+
"version": "5.2.1-beta.0"
|
|
112
113
|
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
|
|
4
|
+
const METHODS = `
|
|
5
|
+
/**
|
|
6
|
+
* Whether the values passed are strictly equal or both NaN.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sameValueZeroEqual: <A, B>(a: A, b: B) => boolean;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Whether the items passed are deeply-equal in value.
|
|
12
|
+
*/
|
|
13
|
+
export declare const deepEqual: <A, B>(a: A, b: B) => boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Whether the items passed are deeply-equal in value based on strict comparison.
|
|
16
|
+
*/
|
|
17
|
+
export declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Whether the items passed are deeply-equal in value, including circular references.
|
|
20
|
+
*/
|
|
21
|
+
export declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Whether the items passed are deeply-equal in value, including circular references,
|
|
24
|
+
* based on strict comparison.
|
|
25
|
+
*/
|
|
26
|
+
export declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Whether the items passed are shallowly-equal in value.
|
|
29
|
+
*/
|
|
30
|
+
export declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Whether the items passed are shallowly-equal in value based on strict comparison
|
|
33
|
+
*/
|
|
34
|
+
export declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Whether the items passed are shallowly-equal in value, including circular references.
|
|
37
|
+
*/
|
|
38
|
+
export declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Whether the items passed are shallowly-equal in value, including circular references,
|
|
41
|
+
* based on strict comparison.
|
|
42
|
+
*/
|
|
43
|
+
export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Create a custom equality comparison method.
|
|
46
|
+
*
|
|
47
|
+
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
48
|
+
* where the standard methods are not performant enough, but can also be used to provide
|
|
49
|
+
* support for legacy environments that cannot polyfill for modern features expected by
|
|
50
|
+
* \`fast-equals\`, such as \`WeakMap\` or \`RegExp.prototype.flags\`.
|
|
51
|
+
*/
|
|
52
|
+
export declare function createCustomEqual<Meta = undefined>(
|
|
53
|
+
options?: CustomEqualCreatorOptions<Meta>,
|
|
54
|
+
): <A, B>(a: A, b: B) => boolean;
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
const INTERNAL_TYPES = fs.readFileSync(
|
|
58
|
+
path.join(import.meta.dirname, '..', 'src', 'internalTypes.ts'),
|
|
59
|
+
);
|
|
60
|
+
|
|
61
|
+
const OUTPUT = `${INTERNAL_TYPES}\n${METHODS}`.trim();
|
|
62
|
+
const OUTPUT_DESTINATION = path.join(import.meta.dirname, '..', 'index.d.ts');
|
|
63
|
+
|
|
64
|
+
fs.writeFileSync(OUTPUT_DESTINATION, OUTPUT, 'utf-8');
|