fast-equals 5.0.0-beta.0 → 5.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/README.md +1 -0
- package/index.d.ts +65 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -202,6 +202,7 @@ console.log(strictDeepEqual(array, ['foo'])); // false;
|
|
|
202
202
|
|
|
203
203
|
Performs the same comparison as `circularDeepEqual` but performs a strict comparison of the objects. In this includes:
|
|
204
204
|
|
|
205
|
+
- Checking `Symbol` properties on the object
|
|
205
206
|
- Checking non-enumerable properties in object comparisons
|
|
206
207
|
- Checking full descriptor of properties on the object to match
|
|
207
208
|
- Checking non-index properties on arrays
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
CreateCustomComparatorConfig,
|
|
3
|
+
CreateState,
|
|
4
|
+
EqualityComparator,
|
|
5
|
+
} from './src/internalTypes';
|
|
6
|
+
import { createInternalComparator, sameValueZeroEqual } from './src/utils';
|
|
7
|
+
export { sameValueZeroEqual };
|
|
8
|
+
|
|
9
|
+
interface DefaultEqualCreatorOptions<Meta> {
|
|
10
|
+
comparator?: EqualityComparator<Meta>;
|
|
11
|
+
circular?: boolean;
|
|
12
|
+
strict?: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface CustomEqualCreatorOptions<Meta>
|
|
15
|
+
extends DefaultEqualCreatorOptions<Meta> {
|
|
16
|
+
createCustomConfig?: CreateCustomComparatorConfig<Meta>;
|
|
17
|
+
createInternalComparator?: typeof createInternalComparator;
|
|
18
|
+
createState?: CreateState<Meta>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Whether the items passed are deeply-equal in value.
|
|
23
|
+
*/
|
|
24
|
+
export declare const deepEqual: <A, B>(a: A, b: B) => boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Whether the items passed are deeply-equal in value based on strict comparison.
|
|
27
|
+
*/
|
|
28
|
+
export declare const strictDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Whether the items passed are deeply-equal in value, including circular references.
|
|
31
|
+
*/
|
|
32
|
+
export declare const circularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Whether the items passed are deeply-equal in value, including circular references,
|
|
35
|
+
* based on strict comparison.
|
|
36
|
+
*/
|
|
37
|
+
export declare const strictCircularDeepEqual: <A, B>(a: A, b: B) => boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether the items passed are shallowly-equal in value.
|
|
40
|
+
*/
|
|
41
|
+
export declare const shallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Whether the items passed are shallowly-equal in value based on strict comparison
|
|
44
|
+
*/
|
|
45
|
+
export declare const strictShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether the items passed are shallowly-equal in value, including circular references.
|
|
48
|
+
*/
|
|
49
|
+
export declare const circularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the items passed are shallowly-equal in value, including circular references,
|
|
52
|
+
* based on strict comparison.
|
|
53
|
+
*/
|
|
54
|
+
export declare const strictCircularShallowEqual: <A, B>(a: A, b: B) => boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Create a custom equality comparison method.
|
|
57
|
+
*
|
|
58
|
+
* This can be done to create very targeted comparisons in extreme hot-path scenarios
|
|
59
|
+
* where the standard methods are not performant enough, but can also be used to provide
|
|
60
|
+
* support for legacy environments that do not support expected features like
|
|
61
|
+
* `RegExp.prototype.flags` out of the box.
|
|
62
|
+
*/
|
|
63
|
+
export declare function createCustomEqual<Meta>(
|
|
64
|
+
options?: CustomEqualCreatorOptions<Meta>,
|
|
65
|
+
): <A, B>(a: A, b: B, metaOverride?: Meta) => boolean;
|
package/package.json
CHANGED