-
Notifications
You must be signed in to change notification settings - Fork 16
/
fast-equals.node.txt
34 lines (25 loc) · 2.33 KB
/
fast-equals.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FAST-EQUALS
ALTERNATIVES ==> # - UTIL.isDeepStrictEqual() (preferred if Node.js only)
# - fast-deep-equal (preferred): most stable
# - fast-equals (preferred if needs feature): circular, shallow, custom
# - deep-equal: not maintained
VERSION ==> #5.0.1
[strict]deepEqual #Deep equal
(VAL, VAL2)->BOOL #Does not compare inherited properties
#Handles NaN, DATE, REGEXP, MAP|SET, TYPEDARR, React elements
#Works cross-realm
#If "strict", compares:
# - non-enumerable properties
# - properties with SYM keys
# - ARR|MAP|SET properties
# - descriptors
[strict]shallowEqual
(VAL, VAL2)->BOOL #Shallow equal
[strict]circularDeep| #Same but allows circular references (slower)
ShallowEqual(VAL, VAL2)->BOOL#Uses WEAKMAP.add|has()
sameValueZeroEqual
(VAL, VAL2)->BOOL #Like Object.is() except for -0 === +0
createCustomEqual(...) #Custom deep equal (see online documentation)
->FUNC4(VAL, VAL2, ANY)->BOOL#ANY is any custom data the caller can pass.