fast-equals 5.3.3-beta.1 → 5.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +128 -77
  3. package/dist/cjs/comparator.d.cts +58 -0
  4. package/dist/cjs/index.cjs +133 -156
  5. package/dist/cjs/index.cjs.map +1 -1
  6. package/dist/cjs/{types/index.d.cts → index.d.cts} +21 -2
  7. package/{src/internalTypes.ts → dist/cjs/internalTypes.d.cts} +7 -43
  8. package/dist/cjs/{types/utils.d.cts → utils.d.cts} +7 -2
  9. package/dist/es/comparator.d.mts +58 -0
  10. package/dist/{esm/types → es}/index.d.mts +21 -2
  11. package/dist/{esm → es}/index.mjs +133 -156
  12. package/dist/es/index.mjs.map +1 -0
  13. package/dist/es/internalTypes.d.mts +174 -0
  14. package/dist/{esm/types → es}/utils.d.mts +7 -2
  15. package/dist/{min/types → umd}/comparator.d.ts +2 -2
  16. package/dist/{min/types → umd}/equals.d.ts +1 -1
  17. package/dist/umd/{types/index.d.ts → index.d.ts} +2 -2
  18. package/dist/umd/index.js +133 -156
  19. package/dist/umd/index.js.map +1 -1
  20. package/dist/umd/{types/utils.d.ts → utils.d.ts} +1 -1
  21. package/index.d.ts +62 -68
  22. package/package.json +46 -54
  23. package/CHANGELOG.md +0 -364
  24. package/dist/cjs/types/comparator.d.cts +0 -26
  25. package/dist/cjs/types/internalTypes.d.cts +0 -157
  26. package/dist/esm/index.mjs.map +0 -1
  27. package/dist/esm/types/comparator.d.mts +0 -26
  28. package/dist/esm/types/internalTypes.d.mts +0 -157
  29. package/dist/min/index.js +0 -1
  30. package/dist/min/types/index.d.ts +0 -47
  31. package/dist/min/types/utils.d.ts +0 -28
  32. package/dist/umd/types/comparator.d.ts +0 -26
  33. package/dist/umd/types/equals.d.ts +0 -54
  34. package/dist/umd/types/internalTypes.d.ts +0 -157
  35. package/src/comparator.ts +0 -376
  36. package/src/equals.ts +0 -355
  37. package/src/index.ts +0 -112
  38. package/src/utils.ts +0 -96
  39. package/dist/cjs/{types/equals.d.cts → equals.d.cts} +1 -1
  40. package/dist/{esm/types → es}/equals.d.mts +1 -1
  41. /package/dist/{min/types → umd}/internalTypes.d.ts +0 -0
@@ -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.ts';\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 `@@toStringTag` of the value, if it exists.\n */\nexport function getShortTag(value: any): string | undefined {\n return value != null ? value[Symbol.toStringTag] : undefined;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(\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 // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\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.js';\nimport type {\n Dictionary,\n PrimitiveWrapper,\n State,\n TypedArray,\n} from './internalTypes.ts';\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 = new Array<true | undefined>(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state) &&\n state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(\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 = new Array<true | undefined>(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex] &&\n state.equals(\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.js';\nimport { combineComparators, createIsCircular, getShortTag } from './utils.js';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes.ts';\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 !== 'undefined' && typeof ArrayBuffer.isView === 'function'\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 unknownTagComparators,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray?.(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a as object);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return (\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 (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict\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 unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({\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.js';\nimport type { CustomEqualCreatorOptions } from './internalTypes.ts';\nimport { sameValueZeroEqual } from './utils.js';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes.ts';\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,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;;;;;;;;;;;;;"}
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.js';\n\nconst { getOwnPropertyNames, getOwnPropertySymbols } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst { hasOwnProperty } = Object.prototype;\n\n/**\n * Combine two comparators into a single comparators.\n */\nexport function combineComparators<Meta>(\n comparatorA: AnyEqualityComparator<Meta>,\n comparatorB: AnyEqualityComparator<Meta>,\n) {\n return function isEqual<A, B>(a: A, b: B, state: State<Meta>) {\n return comparatorA(a, b, state) && comparatorB(a, b, state);\n };\n}\n\n/**\n * Wrap the provided `areItemsEqual` method to manage the circular state, allowing\n * for circular references to be safely included in the comparison without creating\n * stack overflows.\n */\nexport function createIsCircular<AreItemsEqual extends TypeEqualityComparator<any, any>>(\n areItemsEqual: AreItemsEqual,\n): AreItemsEqual {\n return function isCircular(a: any, b: any, state: CircularState<Cache<any, any>>) {\n if (!a || !b || typeof a !== 'object' || typeof b !== 'object') {\n return areItemsEqual(a, b, state);\n }\n\n const { cache } = state;\n\n const cachedA = cache.get(a);\n const cachedB = cache.get(b);\n\n if (cachedA && cachedB) {\n return cachedA === b && cachedB === a;\n }\n\n cache.set(a, b);\n cache.set(b, a);\n\n const result = areItemsEqual(a, b, state);\n\n cache.delete(a);\n cache.delete(b);\n\n return result;\n } as AreItemsEqual;\n}\n\n/**\n * Get the `@@toStringTag` of the value, if it exists.\n */\nexport function getShortTag(value: any): string | undefined {\n return value != null ? (value[Symbol.toStringTag] as string) : undefined;\n}\n\n/**\n * Get the properties to strictly examine, which include both own properties that are\n * not enumerable and symbol properties.\n */\nexport function getStrictProperties(object: Dictionary): Array<string | symbol> {\n return (getOwnPropertyNames(object) as Array<string | symbol>).concat(getOwnPropertySymbols(object));\n}\n\n/**\n * Whether the object contains the property passed as an own property.\n */\nexport const hasOwn =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n Object.hasOwn || ((object: Dictionary, property: number | string | symbol) => hasOwnProperty.call(object, property));\n\n/**\n * Whether the values passed are strictly equal or both NaN.\n */\nexport function sameValueZeroEqual(a: any, b: any): boolean {\n return a === b || (!a && !b && a !== a && b !== b);\n}\n","import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';\nimport { getStrictProperties, hasOwn, sameValueZeroEqual } from './utils.js';\n\nconst PREACT_VNODE = '__v';\nconst PREACT_OWNER = '__o';\nconst REACT_OWNER = '_owner';\n\nconst { getOwnPropertyDescriptor, keys } = Object;\n\n/**\n * Whether the arrays are equal in value.\n */\nexport function areArraysEqual(a: any[], b: any[], state: State<any>) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (!state.equals(a[index], b[index], index, index, a, b, state)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the dates passed are equal in value.\n */\nexport function areDatesEqual(a: Date, b: Date): boolean {\n return sameValueZeroEqual(a.getTime(), b.getTime());\n}\n\n/**\n * Whether the errors passed are equal in value.\n */\nexport function areErrorsEqual(a: Error, b: Error): boolean {\n return a.name === b.name && a.message === b.message && a.cause === b.cause && a.stack === b.stack;\n}\n\n/**\n * Whether the functions passed are equal in value.\n */\nexport function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): boolean {\n return a === b;\n}\n\n/**\n * Whether the `Map`s are equal in value.\n */\nexport function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.entries();\n\n let aResult: IteratorResult<[any, any]>;\n let bResult: IteratorResult<[any, any]>;\n let index = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.entries();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (matchedIndices[matchIndex]) {\n matchIndex++;\n continue;\n }\n\n const aEntry = aResult.value;\n const bEntry = bResult.value;\n\n if (\n state.equals(aEntry[0], bEntry[0], index, matchIndex, a, b, state)\n && state.equals(aEntry[1], bEntry[1], aEntry[0], bEntry[0], a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n\n index++;\n }\n\n return true;\n}\n\n/**\n * Whether the numbers are equal in value.\n */\nexport const areNumbersEqual = sameValueZeroEqual;\n\n/**\n * Whether the objects are equal in value.\n */\nexport function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = keys(a);\n\n let index = properties.length;\n\n if (keys(b).length !== index) {\n return false;\n }\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n if (!isPropertyEqual(a, b, state, properties[index]!)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the objects are equal in value with strict property checking.\n */\nexport function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean {\n const properties = getStrictProperties(a);\n\n let index = properties.length;\n\n if (getStrictProperties(b).length !== index) {\n return false;\n }\n\n let property: string | symbol;\n let descriptorA: ReturnType<typeof getOwnPropertyDescriptor>;\n let descriptorB: ReturnType<typeof getOwnPropertyDescriptor>;\n\n // Decrementing `while` showed faster results than either incrementing or\n // decrementing `for` loop and than an incrementing `while` loop. Declarative\n // methods like `some` / `every` were not used to avoid incurring the garbage\n // cost of anonymous callbacks.\n while (index-- > 0) {\n property = properties[index]!;\n\n if (!isPropertyEqual(a, b, state, property)) {\n return false;\n }\n\n descriptorA = getOwnPropertyDescriptor(a, property);\n descriptorB = getOwnPropertyDescriptor(b, property);\n\n if (\n (descriptorA || descriptorB)\n && (!descriptorA\n || !descriptorB\n || descriptorA.configurable !== descriptorB.configurable\n || descriptorA.enumerable !== descriptorB.enumerable\n || descriptorA.writable !== descriptorB.writable)\n ) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the primitive wrappers passed are equal in value.\n */\nexport function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean {\n return sameValueZeroEqual(a.valueOf(), b.valueOf());\n}\n\n/**\n * Whether the regexps passed are equal in value.\n */\nexport function areRegExpsEqual(a: RegExp, b: RegExp): boolean {\n return a.source === b.source && a.flags === b.flags;\n}\n\n/**\n * Whether the `Set`s are equal in value.\n */\nexport function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean {\n const size = a.size;\n\n if (size !== b.size) {\n return false;\n }\n\n if (!size) {\n return true;\n }\n\n const matchedIndices = new Array<true | undefined>(size);\n const aIterable = a.values();\n\n let aResult: IteratorResult<any>;\n let bResult: IteratorResult<any>;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((aResult = aIterable.next())) {\n if (aResult.done) {\n break;\n }\n\n const bIterable = b.values();\n\n let hasMatch = false;\n let matchIndex = 0;\n\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n while ((bResult = bIterable.next())) {\n if (bResult.done) {\n break;\n }\n\n if (\n !matchedIndices[matchIndex]\n && state.equals(aResult.value, bResult.value, aResult.value, bResult.value, a, b, state)\n ) {\n hasMatch = matchedIndices[matchIndex] = true;\n break;\n }\n\n matchIndex++;\n }\n\n if (!hasMatch) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the TypedArray instances are equal in value.\n */\nexport function areTypedArraysEqual(a: TypedArray, b: TypedArray) {\n let index = a.length;\n\n if (b.length !== index) {\n return false;\n }\n\n while (index-- > 0) {\n if (a[index] !== b[index]) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Whether the URL instances are equal in value.\n */\nexport function areUrlsEqual(a: URL, b: URL): boolean {\n return (\n a.hostname === b.hostname\n && a.pathname === b.pathname\n && a.protocol === b.protocol\n && a.port === b.port\n && a.hash === b.hash\n && a.username === b.username\n && a.password === b.password\n );\n}\n\nfunction isPropertyEqual(a: Dictionary, b: Dictionary, state: State<any>, property: string | symbol) {\n if (\n (property === REACT_OWNER || property === PREACT_OWNER || property === PREACT_VNODE)\n && (a.$$typeof || b.$$typeof)\n ) {\n return true;\n }\n\n return hasOwn(b, property) && state.equals(a[property], b[property], property, property, a, b, state);\n}\n","import {\n areArraysEqual as areArraysEqualDefault,\n areDatesEqual as areDatesEqualDefault,\n areErrorsEqual as areErrorsEqualDefault,\n areFunctionsEqual as areFunctionsEqualDefault,\n areMapsEqual as areMapsEqualDefault,\n areNumbersEqual as areNumbersEqualDefault,\n areObjectsEqual as areObjectsEqualDefault,\n areObjectsEqualStrict as areObjectsEqualStrictDefault,\n arePrimitiveWrappersEqual as arePrimitiveWrappersEqualDefault,\n areRegExpsEqual as areRegExpsEqualDefault,\n areSetsEqual as areSetsEqualDefault,\n areTypedArraysEqual as areTypedArraysEqualDefault,\n areUrlsEqual as areUrlsEqualDefault,\n} from './equals.js';\nimport type {\n ComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n EqualityComparator,\n InternalEqualityComparator,\n State,\n} from './internalTypes.js';\nimport { combineComparators, createIsCircular, getShortTag } from './utils.js';\n\nconst ARGUMENTS_TAG = '[object Arguments]';\nconst BOOLEAN_TAG = '[object Boolean]';\nconst DATE_TAG = '[object Date]';\nconst ERROR_TAG = '[object Error]';\nconst MAP_TAG = '[object Map]';\nconst NUMBER_TAG = '[object Number]';\nconst OBJECT_TAG = '[object Object]';\nconst REG_EXP_TAG = '[object RegExp]';\nconst SET_TAG = '[object Set]';\nconst STRING_TAG = '[object String]';\nconst URL_TAG = '[object URL]';\n\nconst { isArray } = Array;\nconst isTypedArray =\n // eslint-disable-next-line @typescript-eslint/unbound-method\n typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView : null;\nconst { assign } = Object;\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst getTag = Object.prototype.toString.call.bind(Object.prototype.toString) as (a: object) => string;\n\ninterface CreateIsEqualOptions<Meta> {\n circular: boolean;\n comparator: EqualityComparator<Meta>;\n createState: CreateState<Meta> | undefined;\n equals: InternalEqualityComparator<Meta>;\n strict: boolean;\n}\n\n/**\n * Create a comparator method based on the type-specific equality comparators passed.\n */\nexport function createEqualityComparator<Meta>({\n areArraysEqual,\n areDatesEqual,\n areErrorsEqual,\n areFunctionsEqual,\n areMapsEqual,\n areNumbersEqual,\n areObjectsEqual,\n arePrimitiveWrappersEqual,\n areRegExpsEqual,\n areSetsEqual,\n areTypedArraysEqual,\n areUrlsEqual,\n unknownTagComparators,\n}: ComparatorConfig<Meta>): EqualityComparator<Meta> {\n /**\n * compare the value of the two objects and return true if they are equivalent in values\n */\n return function comparator(a: any, b: any, state: State<Meta>): boolean {\n // If the items are strictly equal, no need to do a value comparison.\n if (a === b) {\n return true;\n }\n\n // If either of the items are nullish and fail the strictly equal check\n // above, then they must be unequal.\n if (a == null || b == null) {\n return false;\n }\n\n const type = typeof a;\n\n if (type !== typeof b) {\n return false;\n }\n\n if (type !== 'object') {\n if (type === 'number') {\n return areNumbersEqual(a, b, state);\n }\n\n if (type === 'function') {\n return areFunctionsEqual(a, b, state);\n }\n\n // If a primitive value that is not strictly equal, it must be unequal.\n return false;\n }\n\n const constructor = a.constructor;\n\n // Checks are listed in order of commonality of use-case:\n // 1. Common complex object types (plain object, array)\n // 2. Common data values (date, regexp)\n // 3. Less-common complex object types (map, set)\n // 4. Less-common data values (promise, primitive wrappers)\n // Inherently this is both subjective and assumptive, however\n // when reviewing comparable libraries in the wild this order\n // appears to be generally consistent.\n\n // Constructors should match, otherwise there is potential for false positives\n // between class and subclass or custom object and POJO.\n if (constructor !== b.constructor) {\n return false;\n }\n\n // `isPlainObject` only checks against the object's own realm. Cross-realm\n // comparisons are rare, and will be handled in the ultimate fallback, so\n // we can avoid capturing the string tag.\n if (constructor === Object) {\n return areObjectsEqual(a, b, state);\n }\n\n // `isArray()` works on subclasses and is cross-realm, so we can avoid capturing\n // the string tag or doing an `instanceof` check.\n if (isArray(a)) {\n return areArraysEqual(a, b, state);\n }\n\n // `isTypedArray()` works on all possible TypedArray classes, so we can avoid\n // capturing the string tag or comparing against all possible constructors.\n if (isTypedArray != null && isTypedArray(a)) {\n return areTypedArraysEqual(a, b, state);\n }\n\n // Try to fast-path equality checks for other complex object types in the\n // same realm to avoid capturing the string tag. Strict equality is used\n // instead of `instanceof` because it is more performant for the common\n // use-case. If someone is subclassing a native class, it will be handled\n // with the string tag comparison.\n\n if (constructor === Date) {\n return areDatesEqual(a, b, state);\n }\n\n if (constructor === RegExp) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (constructor === Map) {\n return areMapsEqual(a, b, state);\n }\n\n if (constructor === Set) {\n return areSetsEqual(a, b, state);\n }\n\n // Since this is a custom object, capture the string tag to determing its type.\n // This is reasonably performant in modern environments like v8 and SpiderMonkey.\n const tag = getTag(a as object);\n\n if (tag === DATE_TAG) {\n return areDatesEqual(a, b, state);\n }\n\n // For RegExp, the properties are not enumerable, and therefore will give false positives if\n // tested like a standard object.\n if (tag === REG_EXP_TAG) {\n return areRegExpsEqual(a, b, state);\n }\n\n if (tag === MAP_TAG) {\n return areMapsEqual(a, b, state);\n }\n\n if (tag === SET_TAG) {\n return areSetsEqual(a, b, state);\n }\n\n if (tag === OBJECT_TAG) {\n // The exception for value comparison is custom `Promise`-like class instances. These should\n // be treated the same as standard `Promise` objects, which means strict equality, and if\n // it reaches this point then that strict equality comparison has already failed.\n return typeof a.then !== 'function' && typeof b.then !== 'function' && areObjectsEqual(a, b, state);\n }\n\n // If a URL tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === URL_TAG) {\n return areUrlsEqual(a, b, state);\n }\n\n // If an error tag, it should be tested explicitly. Like RegExp, the properties are not\n // enumerable, and therefore will give false positives if tested like a standard object.\n if (tag === ERROR_TAG) {\n return areErrorsEqual(a, b, state);\n }\n\n // If an arguments tag, it should be treated as a standard object.\n if (tag === ARGUMENTS_TAG) {\n return areObjectsEqual(a, b, state);\n }\n\n // As the penultimate fallback, check if the values passed are primitive wrappers. This\n // is very rare in modern JS, which is why it is deprioritized compared to all other object\n // types.\n if (tag === BOOLEAN_TAG || tag === NUMBER_TAG || tag === STRING_TAG) {\n return arePrimitiveWrappersEqual(a, b, state);\n }\n\n if (unknownTagComparators) {\n let unknownTagComparator = unknownTagComparators[tag];\n\n if (!unknownTagComparator) {\n const shortTag = getShortTag(a);\n\n if (shortTag) {\n unknownTagComparator = unknownTagComparators[shortTag];\n }\n }\n\n // If the custom config has an unknown tag comparator that matches the captured tag or the\n // @@toStringTag, it is the source of truth for whether the values are equal.\n if (unknownTagComparator) {\n return unknownTagComparator(a, b, state);\n }\n }\n\n // If not matching any tags that require a specific type of comparison, then we hard-code false because\n // the only thing remaining is strict equality, which has already been compared. This is for a few reasons:\n // - Certain types that cannot be introspected (e.g., `WeakMap`). For these types, this is the only\n // comparison that can be made.\n // - For types that can be introspected, but rarely have requirements to be compared\n // (`ArrayBuffer`, `DataView`, etc.), the cost is avoided to prioritize the common\n // use-cases (may be included in a future release, if requested enough).\n // - For types that can be introspected but do not have an objective definition of what\n // equality is (`Error`, etc.), the subjective decision is to be conservative and strictly compare.\n // In all cases, these decisions should be reevaluated based on changes to the language and\n // common development practices.\n return false;\n };\n}\n\n/**\n * Create the configuration object used for building comparators.\n */\nexport function createEqualityComparatorConfig<Meta>({\n circular,\n createCustomConfig,\n strict,\n}: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta> {\n let config = {\n areArraysEqual: strict ? areObjectsEqualStrictDefault : areArraysEqualDefault,\n areDatesEqual: areDatesEqualDefault,\n areErrorsEqual: areErrorsEqualDefault,\n areFunctionsEqual: areFunctionsEqualDefault,\n areMapsEqual: strict ? combineComparators(areMapsEqualDefault, areObjectsEqualStrictDefault) : areMapsEqualDefault,\n areNumbersEqual: areNumbersEqualDefault,\n areObjectsEqual: strict ? areObjectsEqualStrictDefault : areObjectsEqualDefault,\n arePrimitiveWrappersEqual: arePrimitiveWrappersEqualDefault,\n areRegExpsEqual: areRegExpsEqualDefault,\n areSetsEqual: strict ? combineComparators(areSetsEqualDefault, areObjectsEqualStrictDefault) : areSetsEqualDefault,\n areTypedArraysEqual: strict ? areObjectsEqualStrictDefault : areTypedArraysEqualDefault,\n areUrlsEqual: areUrlsEqualDefault,\n unknownTagComparators: undefined,\n };\n\n if (createCustomConfig) {\n config = assign({}, config, createCustomConfig(config));\n }\n\n if (circular) {\n const areArraysEqual = createIsCircular(config.areArraysEqual);\n const areMapsEqual = createIsCircular(config.areMapsEqual);\n const areObjectsEqual = createIsCircular(config.areObjectsEqual);\n const areSetsEqual = createIsCircular(config.areSetsEqual);\n\n config = assign({}, config, {\n areArraysEqual,\n areMapsEqual,\n areObjectsEqual,\n areSetsEqual,\n });\n }\n\n return config;\n}\n\n/**\n * Default equality comparator pass-through, used as the standard `isEqual` creator for\n * use inside the built comparator.\n */\nexport function createInternalEqualityComparator<Meta>(\n compare: EqualityComparator<Meta>,\n): InternalEqualityComparator<Meta> {\n return function (\n a: any,\n b: any,\n _indexOrKeyA: any,\n _indexOrKeyB: any,\n _parentA: any,\n _parentB: any,\n state: State<Meta>,\n ) {\n return compare(a, b, state);\n };\n}\n\n/**\n * Create the `isEqual` function used by the consuming application.\n */\nexport function createIsEqual<Meta>({ circular, comparator, createState, equals, strict }: CreateIsEqualOptions<Meta>) {\n if (createState) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n const { cache = circular ? new WeakMap() : undefined, meta } = createState();\n\n return comparator(a, b, {\n cache,\n equals,\n meta,\n strict,\n } as State<Meta>);\n };\n }\n\n if (circular) {\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, {\n cache: new WeakMap(),\n equals,\n meta: undefined as Meta,\n strict,\n } as State<Meta>);\n };\n }\n\n const state = {\n cache: undefined,\n equals,\n meta: undefined,\n strict,\n } as State<Meta>;\n\n return function isEqual<A, B>(a: A, b: B): boolean {\n return comparator(a, b, state);\n };\n}\n","import {\n createEqualityComparatorConfig,\n createEqualityComparator,\n createInternalEqualityComparator,\n createIsEqual,\n} from './comparator.js';\nimport type { CustomEqualCreatorOptions } from './internalTypes.js';\nimport { sameValueZeroEqual } from './utils.js';\n\nexport { sameValueZeroEqual };\nexport type {\n AnyEqualityComparator,\n Cache,\n CircularState,\n ComparatorConfig,\n CreateCustomComparatorConfig,\n CreateState,\n CustomEqualCreatorOptions,\n DefaultState,\n Dictionary,\n EqualityComparator,\n EqualityComparatorCreator,\n InternalEqualityComparator,\n PrimitiveWrapper,\n State,\n TypeEqualityComparator,\n TypedArray,\n} from './internalTypes.js';\n\n/**\n * Whether the items passed are deeply-equal in value.\n */\nexport const deepEqual = createCustomEqual();\n\n/**\n * Whether the items passed are deeply-equal in value based on strict comparison.\n */\nexport const strictDeepEqual = createCustomEqual({ strict: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references.\n */\nexport const circularDeepEqual = createCustomEqual({ circular: true });\n\n/**\n * Whether the items passed are deeply-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularDeepEqual = createCustomEqual({\n circular: true,\n strict: true,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value.\n */\nexport const shallowEqual = createCustomEqual({\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value based on strict comparison\n */\nexport const strictShallowEqual = createCustomEqual({\n strict: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references.\n */\nexport const circularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n});\n\n/**\n * Whether the items passed are shallowly-equal in value, including circular references,\n * based on strict comparison.\n */\nexport const strictCircularShallowEqual = createCustomEqual({\n circular: true,\n createInternalComparator: () => sameValueZeroEqual,\n strict: true,\n});\n\n/**\n * Create a custom equality comparison method.\n *\n * This can be done to create very targeted comparisons in extreme hot-path scenarios\n * where the standard methods are not performant enough, but can also be used to provide\n * support for legacy environments that do not support expected features like\n * `RegExp.prototype.flags` out of the box.\n */\nexport function createCustomEqual<Meta = undefined>(options: CustomEqualCreatorOptions<Meta> = {}) {\n const {\n circular = false,\n createInternalComparator: createCustomInternalComparator,\n createState,\n strict = false,\n } = options;\n\n const config = createEqualityComparatorConfig<Meta>(options);\n const comparator = createEqualityComparator(config);\n const equals = createCustomInternalComparator\n ? createCustomInternalComparator(comparator)\n : createInternalEqualityComparator(comparator);\n\n return createIsEqual({ circular, comparator, createState, equals, strict });\n}\n"],"names":["areObjectsEqualStrictDefault","areArraysEqualDefault","areDatesEqualDefault","areErrorsEqualDefault","areFunctionsEqualDefault","areMapsEqualDefault","areNumbersEqualDefault","areObjectsEqualDefault","arePrimitiveWrappersEqualDefault","areRegExpsEqualDefault","areSetsEqualDefault","areTypedArraysEqualDefault","areUrlsEqualDefault"],"mappings":";;;;;;IASA,MAAM,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,GAAG,MAAM;IAC7D;IACA,MAAM,EAAE,cAAc,EAAE,GAAG,MAAM,CAAC,SAAS;IAE3C;;IAEG;IACG,SAAU,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;IAC7D,IAAA,CAAC;I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A,QAAQ,EAAE,IAAI;IACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;IACnD,CAAA;IAED;;;IAGG;AACI,UAAM,0BAA0B,GAAG,iBAAiB,CAAC;IAC1D,IAAA,QAAQ,EAAE,IAAI;IACd,IAAA,wBAAwB,EAAE,MAAM,kBAAkB;IAClD,IAAA,MAAM,EAAE,IAAI;IACb,CAAA;IAED;;;;;;;IAOG;IACG,SAAU,iBAAiB,CAAmB,OAAA,GAA2C,EAAE,EAAA;IAC/F,IAAA,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,wBAAwB,EAAE,8BAA8B,EACxD,WAAW,EACX,MAAM,GAAG,KAAK,GACf,GAAG,OAAO;IAEX,IAAA,MAAM,MAAM,GAAG,8BAA8B,CAAO,OAAO,CAAC;IAC5D,IAAA,MAAM,UAAU,GAAG,wBAAwB,CAAC,MAAM,CAAC;QACnD,MAAM,MAAM,GAAG;IACb,UAAE,8BAA8B,CAAC,UAAU;IAC3C,UAAE,gCAAgC,CAAC,UAAU,CAAC;IAEhD,IAAA,OAAO,aAAa,CAAC,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IAC7E;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import type { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes.ts';
1
+ import type { AnyEqualityComparator, Dictionary, State, TypeEqualityComparator } from './internalTypes.js';
2
2
  /**
3
3
  * Combine two comparators into a single comparators.
4
4
  */
package/index.d.ts CHANGED
@@ -2,13 +2,12 @@
2
2
  * Cache used to store references to objects, used for circular
3
3
  * reference checks.
4
4
  */
5
- export interface Cache<Key extends object, Value> {
5
+ interface Cache<Key extends object, Value> {
6
6
  delete(key: Key): boolean;
7
7
  get(key: Key): Value | undefined;
8
8
  set(key: Key, value: any): any;
9
9
  }
10
-
11
- export interface State<Meta> {
10
+ interface State<Meta> {
12
11
  /**
13
12
  * Cache used to identify circular references
14
13
  */
@@ -28,21 +27,17 @@ export interface State<Meta> {
28
27
  */
29
28
  readonly strict: boolean;
30
29
  }
31
-
32
- export interface CircularState<Meta> extends State<Meta> {
30
+ interface CircularState<Meta> extends State<Meta> {
33
31
  readonly cache: Cache<any, any>;
34
32
  }
35
-
36
- export interface DefaultState<Meta> extends State<Meta> {
33
+ interface DefaultState<Meta> extends State<Meta> {
37
34
  readonly cache: undefined;
38
35
  }
39
-
40
- export interface Dictionary<Value = any> {
36
+ interface Dictionary<Value = any> {
41
37
  [key: string | symbol]: Value;
42
38
  $$typeof?: any;
43
39
  }
44
-
45
- export interface ComparatorConfig<Meta> {
40
+ interface ComparatorConfig<Meta> {
46
41
  /**
47
42
  * Whether the arrays passed are equal in value. In strict mode, this includes
48
43
  * additional properties added to the array.
@@ -102,36 +97,17 @@ export interface ComparatorConfig<Meta> {
102
97
  *
103
98
  * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/toStringTag
104
99
  */
105
- unknownTagComparators:
106
- | Record<string, TypeEqualityComparator<any, Meta>>
107
- | undefined;
100
+ unknownTagComparators: Record<string, TypeEqualityComparator<any, Meta>> | undefined;
108
101
  }
109
-
110
- export type CreateCustomComparatorConfig<Meta> = (
111
- config: ComparatorConfig<Meta>,
112
- ) => Partial<ComparatorConfig<Meta>>;
113
-
114
- export type CreateState<Meta> = () => {
102
+ type CreateCustomComparatorConfig<Meta> = (config: ComparatorConfig<Meta>) => Partial<ComparatorConfig<Meta>>;
103
+ type CreateState<Meta> = () => {
115
104
  cache?: Cache<any, any> | undefined;
116
105
  meta?: Meta;
117
106
  };
118
-
119
- export type EqualityComparator<Meta> = <A, B>(
120
- a: A,
121
- b: B,
122
- state: State<Meta>,
123
- ) => boolean;
124
- export type AnyEqualityComparator<Meta> = (
125
- a: any,
126
- b: any,
127
- state: State<Meta>,
128
- ) => boolean;
129
-
130
- export type EqualityComparatorCreator<Meta> = (
131
- fn: EqualityComparator<Meta>,
132
- ) => InternalEqualityComparator<Meta>;
133
-
134
- export type InternalEqualityComparator<Meta> = (
107
+ type EqualityComparator<Meta> = <A, B>(a: A, b: B, state: State<Meta>) => boolean;
108
+ type AnyEqualityComparator<Meta> = (a: any, b: any, state: State<Meta>) => boolean;
109
+ type EqualityComparatorCreator<Meta> = (fn: EqualityComparator<Meta>) => InternalEqualityComparator<Meta>;
110
+ type InternalEqualityComparator<Meta> = (
135
111
  a: any,
136
112
  b: any,
137
113
  indexOrKeyA: any,
@@ -140,11 +116,7 @@ export type InternalEqualityComparator<Meta> = (
140
116
  parentB: any,
141
117
  state: State<Meta>,
142
118
  ) => boolean;
143
-
144
- // We explicitly check for primitive wrapper types
145
- // eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
146
- export type PrimitiveWrapper = Boolean | Number | String;
147
-
119
+ type PrimitiveWrapper = Boolean | Number | String;
148
120
  /**
149
121
  * Type which encompasses possible instances of TypedArray
150
122
  * classes.
@@ -156,7 +128,7 @@ export type PrimitiveWrapper = Boolean | Number | String;
156
128
  * instance as `TypedArray` and it will work as expected,
157
129
  * because runtime checks will still work for those classes.
158
130
  */
159
- export type TypedArray =
131
+ type TypedArray =
160
132
  | Float32Array
161
133
  | Float64Array
162
134
  | Int8Array
@@ -166,14 +138,8 @@ export type TypedArray =
166
138
  | Uint32Array
167
139
  | Uint8Array
168
140
  | Uint8ClampedArray;
169
-
170
- export type TypeEqualityComparator<Type, Meta = undefined> = (
171
- a: Type,
172
- b: Type,
173
- state: State<Meta>,
174
- ) => boolean;
175
-
176
- export interface CustomEqualCreatorOptions<Meta> {
141
+ type TypeEqualityComparator<Type, Meta = undefined> = (a: Type, b: Type, state: State<Meta>) => boolean;
142
+ interface CustomEqualCreatorOptions<Meta> {
177
143
  /**
178
144
  * Whether circular references should be supported. It causes the
179
145
  * comparison to be slower, but for objects that have circular references
@@ -193,9 +159,7 @@ export interface CustomEqualCreatorOptions<Meta> {
193
159
  * class instance differently than other objects) or to incorporate `meta` in
194
160
  * the comparison. See the recipes for examples.
195
161
  */
196
- createInternalComparator?: (
197
- compare: EqualityComparator<Meta>,
198
- ) => InternalEqualityComparator<Meta>;
162
+ createInternalComparator?: (compare: EqualityComparator<Meta>) => InternalEqualityComparator<Meta>;
199
163
  /**
200
164
  * Create a custom `state` object passed between the methods. This allows for
201
165
  * custom `cache` and/or `meta` values to be used.
@@ -209,54 +173,84 @@ export interface CustomEqualCreatorOptions<Meta> {
209
173
  strict?: boolean;
210
174
  }
211
175
 
212
-
213
176
  /**
214
177
  * Whether the values passed are strictly equal or both NaN.
215
178
  */
216
- export declare const sameValueZeroEqual: <A, B>(a: A, b: B) => boolean;
179
+ declare function sameValueZeroEqual(a: any, b: any): boolean;
217
180
 
218
181
  /**
219
182
  * Whether the items passed are deeply-equal in value.
220
183
  */
221
- export declare const deepEqual: <A, B>(a: A, b: B) => boolean;
184
+ declare const deepEqual: <A, B>(a: A, b: B) => boolean;
222
185
  /**
223
186
  * Whether the items passed are deeply-equal in value based on strict comparison.
224
187
  */
225
- export declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
188
+ declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
226
189
  /**
227
190
  * Whether the items passed are deeply-equal in value, including circular references.
228
191
  */
229
- export declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
192
+ declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
230
193
  /**
231
194
  * Whether the items passed are deeply-equal in value, including circular references,
232
195
  * based on strict comparison.
233
196
  */
234
- export declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
197
+ declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
235
198
  /**
236
199
  * Whether the items passed are shallowly-equal in value.
237
200
  */
238
- export declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
201
+ declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
239
202
  /**
240
203
  * Whether the items passed are shallowly-equal in value based on strict comparison
241
204
  */
242
- export declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
205
+ declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
243
206
  /**
244
207
  * Whether the items passed are shallowly-equal in value, including circular references.
245
208
  */
246
- export declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
209
+ declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
247
210
  /**
248
211
  * Whether the items passed are shallowly-equal in value, including circular references,
249
212
  * based on strict comparison.
250
213
  */
251
- export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
214
+ declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
252
215
  /**
253
216
  * Create a custom equality comparison method.
254
217
  *
255
218
  * This can be done to create very targeted comparisons in extreme hot-path scenarios
256
219
  * where the standard methods are not performant enough, but can also be used to provide
257
- * support for legacy environments that cannot polyfill for modern features expected by
258
- * `fast-equals`, such as `WeakMap` or `RegExp.prototype.flags`.
220
+ * support for legacy environments that do not support expected features like
221
+ * `RegExp.prototype.flags` out of the box.
259
222
  */
260
- export declare function createCustomEqual<Meta = undefined>(
223
+ declare function createCustomEqual<Meta = undefined>(
261
224
  options?: CustomEqualCreatorOptions<Meta>,
262
- ): <A, B>(a: A, b: B) => boolean;
225
+ ): <A, B>(a: A, b: B) => boolean;
226
+
227
+ export {
228
+ circularDeepEqual,
229
+ circularShallowEqual,
230
+ createCustomEqual,
231
+ deepEqual,
232
+ sameValueZeroEqual,
233
+ shallowEqual,
234
+ strictCircularDeepEqual,
235
+ strictCircularShallowEqual,
236
+ strictDeepEqual,
237
+ strictShallowEqual,
238
+ };
239
+ export type {
240
+ AnyEqualityComparator,
241
+ Cache,
242
+ CircularState,
243
+ ComparatorConfig,
244
+ CreateCustomComparatorConfig,
245
+ CreateState,
246
+ CustomEqualCreatorOptions,
247
+ DefaultState,
248
+ Dictionary,
249
+ EqualityComparator,
250
+ EqualityComparatorCreator,
251
+ InternalEqualityComparator,
252
+ PrimitiveWrapper,
253
+ State,
254
+ TypeEqualityComparator,
255
+ TypedArray,
256
+ };
package/package.json CHANGED
@@ -6,48 +6,40 @@
6
6
  },
7
7
  "description": "A blazing fast equality comparison, either shallow or deep",
8
8
  "devDependencies": {
9
- "@rollup/plugin-commonjs": "^29.0.0",
10
- "@rollup/plugin-node-resolve": "^16.0.3",
11
- "@rollup/plugin-replace": "^6.0.3",
12
- "@rollup/plugin-terser": "^0.4.4",
13
- "@rollup/plugin-typescript": "^12.3.0",
14
- "@types/lodash": "^4.17.20",
15
- "@types/node": "^24.10.0",
9
+ "@planttheidea/build-tools": "^1.2.3",
10
+ "@types/lodash": "^4.17.21",
11
+ "@types/node": "^24.10.3",
16
12
  "@types/ramda": "^0.31.1",
17
- "@types/react": "^19.2.2",
18
- "@types/react-dom": "^19.2.2",
19
- "@typescript-eslint/eslint-plugin": "^8.46.3",
20
- "@typescript-eslint/parser": "^8.46.3",
21
- "@vitest/coverage-v8": "4.0.7",
13
+ "@types/react": "^19.2.7",
14
+ "@types/react-dom": "^19.2.3",
15
+ "@typescript-eslint/eslint-plugin": "^8.49.0",
16
+ "@typescript-eslint/parser": "^8.49.0",
17
+ "@vitest/coverage-v8": "^4.0.15",
18
+ "cli-table3": "^0.6.5",
22
19
  "decircularize": "^1.0.0",
23
20
  "deep-eql": "^5.0.2",
24
21
  "deep-equal": "^2.2.3",
25
22
  "dequal": "^2.0.3",
26
23
  "eslint": "^9.39.1",
27
24
  "eslint-friendly-formatter": "^4.0.1",
28
- "eslint-webpack-plugin": "^5.0.2",
25
+ "eslint-plugin-import": "^2.32.0",
29
26
  "fast-deep-equal": "^3.1.3",
30
27
  "fast-glob": "^3.3.3",
31
- "html-webpack-plugin": "^5.6.4",
32
- "in-publish": "^2.0.1",
33
28
  "lodash": "^4.17.21",
34
29
  "nano-equal": "^2.0.2",
35
- "prettier": "^3.6.2",
36
- "react": "^19.2.0",
37
- "react-dom": "^19.2.0",
30
+ "prettier": "^3.7.4",
31
+ "react": "^19.2.3",
32
+ "react-dom": "^19.2.3",
38
33
  "react-fast-compare": "^3.2.2",
39
- "release-it": "^19.0.5",
40
- "rollup": "^4.52.5",
34
+ "release-it": "^19.1.0",
35
+ "rollup": "^4.53.3",
41
36
  "shallow-equal-fuzzy": "^0.0.2",
42
- "tinybench": "^5.1.0",
43
- "ts-loader": "^9.5.4",
37
+ "tinybench": "^6.0.0",
44
38
  "typescript": "^5.9.3",
45
- "typescript-eslint": "^8.46.3",
39
+ "typescript-eslint": "^8.49.0",
46
40
  "underscore": "^1.13.7",
47
- "vitest": "^4.0.7",
48
- "webpack": "^5.102.1",
49
- "webpack-cli": "^6.0.1",
50
- "webpack-dev-server": "^5.2.2"
41
+ "vite": "^7.2.7",
42
+ "vitest": "^4.0.15"
51
43
  },
52
44
  "engines": {
53
45
  "node": ">=6.0.0"
@@ -55,27 +47,25 @@
55
47
  "exports": {
56
48
  ".": {
57
49
  "import": {
58
- "types": "./dist/esm/types/index.d.mts",
59
- "default": "./dist/esm/index.mjs"
50
+ "types": "./dist/es/index.d.mts",
51
+ "default": "./dist/es/index.mjs"
60
52
  },
61
53
  "require": {
62
- "types": "./dist/cjs/types/index.d.cts",
54
+ "types": "./dist/cjs/index.d.cts",
63
55
  "default": "./dist/cjs/index.cjs"
64
56
  },
65
57
  "default": {
66
- "types": "./dist/umd/types/index.d.ts",
58
+ "types": "./dist/umd/index.d.ts",
67
59
  "default": "./dist/umd/index.js"
68
60
  }
69
61
  }
70
62
  },
71
63
  "files": [
72
64
  "dist",
73
- "src",
74
- "CHANGELOG.md",
75
- "index.d.ts",
76
65
  "LICENSE",
77
- "package.json",
78
- "README.md"
66
+ "README.md",
67
+ "index.d.ts",
68
+ "package.json"
79
69
  ],
80
70
  "homepage": "https://github.com/planttheidea/fast-equals#readme",
81
71
  "keywords": [
@@ -87,35 +77,37 @@
87
77
  ],
88
78
  "license": "MIT",
89
79
  "main": "dist/cjs/index.cjs",
90
- "module": "dist/esm/index.mjs",
80
+ "module": "dist/es/index.mjs",
91
81
  "name": "fast-equals",
92
82
  "repository": {
93
83
  "type": "git",
94
84
  "url": "git+https://github.com/planttheidea/fast-equals.git"
95
85
  },
96
86
  "scripts": {
97
- "benchmark": "npm run build:esm && node benchmark/index.js",
98
- "build": "npm run build:esm && npm run build:cjs && npm run build:umd && npm run build:min && npm run build:types",
99
- "build:cjs": "rm -rf dist/cjs && NODE_ENV=production rollup -c config/rollup/config.cjs.js && tsc -p ./config/tsconfig/cjs.json && node scripts/create-cts-files.js",
100
- "build:esm": "rm -rf dist/esm && NODE_ENV=production rollup -c config/rollup/config.esm.js && tsc -p ./config/tsconfig/esm.json && node scripts/create-mts-files.js",
101
- "build:min": "rm -rf dist/min && NODE_ENV=production rollup -c config/rollup/config.min.js && tsc -p ./config/tsconfig/min.json",
102
- "build:types": "node scripts/fallback-types.js",
103
- "build:umd": "rm -rf dist/umd && NODE_ENV=production rollup -c config/rollup/config.umd.js && tsc -p ./config/tsconfig/umd.json",
104
- "dev": "NODE_ENV=development webpack serve --progress --config=config/webpack.config.js",
105
- "format": "prettier **/*.ts --write",
106
- "lint": "eslint src/*.ts",
87
+ "benchmark": "npm run build && node benchmark/index.js",
88
+ "build": "npm run clean && npm run build:dist && npm run build:types",
89
+ "build:dist": "NODE_ENV=production rollup -c config/rollup.config.js",
90
+ "build:types": "pti fix-types -l dist",
91
+ "clean": "rm -rf dist",
92
+ "clean:cjs": "rm -rf dist/cjs",
93
+ "clean:es": "rm -rf dist/es",
94
+ "clean:umd": "rm -rf dist/umd",
95
+ "dev": "vite --config=config/vite.config.ts",
96
+ "format": "prettier . --log-level=warn --write",
97
+ "format:check": "prettier . --log-level=warn --check",
98
+ "lint": "eslint --max-warnings=0",
107
99
  "lint:fix": "npm run lint -- --fix",
100
+ "release:alpha": "release-it --config=config/release-it/alpha.json",
101
+ "release:beta": "release-it --config=config/release-it/beta.json",
102
+ "release:rc": "release-it --config=config/release-it/rc.json",
103
+ "release:scripts": "npm run format:check && npm run typecheck && npm run lint && npm run test && npm run build",
104
+ "release:stable": "release-it --config=config/release-it/stable.json",
108
105
  "start": "npm run dev",
109
- "release": "release-it",
110
- "release:beta": "release-it --config=.release-it.beta.json",
111
- "release:scripts": "npm run typecheck && npm run lint && npm run test:coverage && npm run build",
112
- "test": "vitest run",
113
- "test:coverage": "rm -rf coverage && vitest run --coverage",
114
- "test:watch": "vitest",
106
+ "test": "vitest run --config=config/vitest.config.ts",
115
107
  "typecheck": "tsc --noEmit"
116
108
  },
117
109
  "sideEffects": false,
118
110
  "type": "module",
119
111
  "types": "./index.d.ts",
120
- "version": "5.3.3-beta.1"
112
+ "version": "5.3.4"
121
113
  }