fast-equals 5.4.0 → 6.0.0-beta.1
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/dist/cjs/index.cjs +0 -1
- package/dist/cjs/index.d.cts +177 -32
- package/dist/es/index.d.mts +177 -32
- package/dist/es/index.mjs +0 -1
- package/index.d.ts +132 -181
- package/package.json +13 -13
- package/dist/cjs/comparator.d.cts +0 -60
- package/dist/cjs/equals.d.cts +0 -62
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/internalTypes.d.cts +0 -178
- package/dist/cjs/utils.d.cts +0 -33
- package/dist/es/comparator.d.mts +0 -60
- package/dist/es/equals.d.mts +0 -62
- package/dist/es/index.mjs.map +0 -1
- package/dist/es/internalTypes.d.mts +0 -178
- package/dist/es/utils.d.mts +0 -33
- package/dist/umd/comparator.d.ts +0 -26
- package/dist/umd/equals.d.ts +0 -62
- package/dist/umd/index.d.ts +0 -47
- package/dist/umd/index.js +0 -659
- package/dist/umd/index.js.map +0 -1
- package/dist/umd/internalTypes.d.ts +0 -159
- package/dist/umd/utils.d.ts +0 -28
package/dist/umd/comparator.d.ts
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import type { ComparatorConfig, CreateState, CustomEqualCreatorOptions, EqualityComparator, InternalEqualityComparator } from './internalTypes.js';
|
|
2
|
-
interface CreateIsEqualOptions<Meta> {
|
|
3
|
-
circular: boolean;
|
|
4
|
-
comparator: EqualityComparator<Meta>;
|
|
5
|
-
createState: CreateState<Meta> | undefined;
|
|
6
|
-
equals: InternalEqualityComparator<Meta>;
|
|
7
|
-
strict: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Create a comparator method based on the type-specific equality comparators passed.
|
|
11
|
-
*/
|
|
12
|
-
export declare function createEqualityComparator<Meta>({ areArrayBuffersEqual, areArraysEqual, areDataViewsEqual, areDatesEqual, areErrorsEqual, areFunctionsEqual, areMapsEqual, areNumbersEqual, areObjectsEqual, arePrimitiveWrappersEqual, areRegExpsEqual, areSetsEqual, areTypedArraysEqual, areUrlsEqual, unknownTagComparators, }: ComparatorConfig<Meta>): EqualityComparator<Meta>;
|
|
13
|
-
/**
|
|
14
|
-
* Create the configuration object used for building comparators.
|
|
15
|
-
*/
|
|
16
|
-
export declare function createEqualityComparatorConfig<Meta>({ circular, createCustomConfig, strict, }: CustomEqualCreatorOptions<Meta>): ComparatorConfig<Meta>;
|
|
17
|
-
/**
|
|
18
|
-
* Default equality comparator pass-through, used as the standard `isEqual` creator for
|
|
19
|
-
* use inside the built comparator.
|
|
20
|
-
*/
|
|
21
|
-
export declare function createInternalEqualityComparator<Meta>(compare: EqualityComparator<Meta>): InternalEqualityComparator<Meta>;
|
|
22
|
-
/**
|
|
23
|
-
* Create the `isEqual` function used by the consuming application.
|
|
24
|
-
*/
|
|
25
|
-
export declare function createIsEqual<Meta>({ circular, comparator, createState, equals, strict }: CreateIsEqualOptions<Meta>): <A, B>(a: A, b: B) => boolean;
|
|
26
|
-
export {};
|
package/dist/umd/equals.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { Dictionary, PrimitiveWrapper, State, TypedArray } from './internalTypes.js';
|
|
2
|
-
import { sameValueZeroEqual } from './utils.js';
|
|
3
|
-
/**
|
|
4
|
-
* Whether the array buffers are equal in value.
|
|
5
|
-
*/
|
|
6
|
-
export declare function areArrayBuffersEqual(a: ArrayBuffer, b: ArrayBuffer): boolean;
|
|
7
|
-
/**
|
|
8
|
-
* Whether the arrays are equal in value.
|
|
9
|
-
*/
|
|
10
|
-
export declare function areArraysEqual(a: any[], b: any[], state: State<any>): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Whether the dataviews are equal in value.
|
|
13
|
-
*/
|
|
14
|
-
export declare function areDataViewsEqual(a: DataView, b: DataView): boolean;
|
|
15
|
-
/**
|
|
16
|
-
* Whether the dates passed are equal in value.
|
|
17
|
-
*/
|
|
18
|
-
export declare function areDatesEqual(a: Date, b: Date): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Whether the errors passed are equal in value.
|
|
21
|
-
*/
|
|
22
|
-
export declare function areErrorsEqual(a: Error, b: Error): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Whether the functions passed are equal in value.
|
|
25
|
-
*/
|
|
26
|
-
export declare function areFunctionsEqual(a: (...args: any[]) => any, b: (...args: any[]) => any): boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Whether the `Map`s are equal in value.
|
|
29
|
-
*/
|
|
30
|
-
export declare function areMapsEqual(a: Map<any, any>, b: Map<any, any>, state: State<any>): boolean;
|
|
31
|
-
/**
|
|
32
|
-
* Whether the numbers are equal in value.
|
|
33
|
-
*/
|
|
34
|
-
export declare const areNumbersEqual: typeof sameValueZeroEqual;
|
|
35
|
-
/**
|
|
36
|
-
* Whether the objects are equal in value.
|
|
37
|
-
*/
|
|
38
|
-
export declare function areObjectsEqual(a: Dictionary, b: Dictionary, state: State<any>): boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Whether the objects are equal in value with strict property checking.
|
|
41
|
-
*/
|
|
42
|
-
export declare function areObjectsEqualStrict(a: Dictionary, b: Dictionary, state: State<any>): boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Whether the primitive wrappers passed are equal in value.
|
|
45
|
-
*/
|
|
46
|
-
export declare function arePrimitiveWrappersEqual(a: PrimitiveWrapper, b: PrimitiveWrapper): boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Whether the regexps passed are equal in value.
|
|
49
|
-
*/
|
|
50
|
-
export declare function areRegExpsEqual(a: RegExp, b: RegExp): boolean;
|
|
51
|
-
/**
|
|
52
|
-
* Whether the `Set`s are equal in value.
|
|
53
|
-
*/
|
|
54
|
-
export declare function areSetsEqual(a: Set<any>, b: Set<any>, state: State<any>): boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Whether the TypedArray instances are equal in value.
|
|
57
|
-
*/
|
|
58
|
-
export declare function areTypedArraysEqual(a: TypedArray, b: TypedArray): boolean;
|
|
59
|
-
/**
|
|
60
|
-
* Whether the URL instances are equal in value.
|
|
61
|
-
*/
|
|
62
|
-
export declare function areUrlsEqual(a: URL, b: URL): boolean;
|
package/dist/umd/index.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { CustomEqualCreatorOptions } from './internalTypes.js';
|
|
2
|
-
import { sameValueZeroEqual } from './utils.js';
|
|
3
|
-
export { sameValueZeroEqual };
|
|
4
|
-
export type { AnyEqualityComparator, Cache, CircularState, ComparatorConfig, CreateCustomComparatorConfig, CreateState, CustomEqualCreatorOptions, DefaultState, Dictionary, EqualityComparator, EqualityComparatorCreator, InternalEqualityComparator, PrimitiveWrapper, State, TypeEqualityComparator, TypedArray, } from './internalTypes.js';
|
|
5
|
-
/**
|
|
6
|
-
* Whether the items passed are deeply-equal in value.
|
|
7
|
-
*/
|
|
8
|
-
export declare const deepEqual: <A, B>(a: A, b: B) => boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Whether the items passed are deeply-equal in value based on strict comparison.
|
|
11
|
-
*/
|
|
12
|
-
export declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
13
|
-
/**
|
|
14
|
-
* Whether the items passed are deeply-equal in value, including circular references.
|
|
15
|
-
*/
|
|
16
|
-
export declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Whether the items passed are deeply-equal in value, including circular references,
|
|
19
|
-
* based on strict comparison.
|
|
20
|
-
*/
|
|
21
|
-
export declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Whether the items passed are shallowly-equal in value.
|
|
24
|
-
*/
|
|
25
|
-
export declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Whether the items passed are shallowly-equal in value based on strict comparison
|
|
28
|
-
*/
|
|
29
|
-
export declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the items passed are shallowly-equal in value, including circular references.
|
|
32
|
-
*/
|
|
33
|
-
export declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Whether the items passed are shallowly-equal in value, including circular references,
|
|
36
|
-
* based on strict comparison.
|
|
37
|
-
*/
|
|
38
|
-
export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
39
|
-
/**
|
|
40
|
-
* Create a custom equality comparison method.
|
|
41
|
-
*
|
|
42
|
-
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
43
|
-
* where the standard methods are not performant enough, but can also be used to provide
|
|
44
|
-
* support for legacy environments that do not support expected features like
|
|
45
|
-
* `RegExp.prototype.flags` out of the box.
|
|
46
|
-
*/
|
|
47
|
-
export declare function createCustomEqual<Meta = undefined>(options?: CustomEqualCreatorOptions<Meta>): <A, B>(a: A, b: B) => boolean;
|