You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Receives a state and a modifier function. Returns modified state. Original state object is left untouched.
253
+
254
+
Modifier function receives draft state as the argument. We can use mutating methods like `push`, `pop`, `splice`, `delete` without any issues on that parameter.
Copy file name to clipboardExpand all lines: docs/pure/objects.md
+44Lines changed: 44 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,49 @@
1
1
# Object operations
2
2
3
+
## matchesImpl
4
+
5
+
Curried: false
6
+
Failsafe status: failsafe by default
7
+
8
+
Non curried version of [matches](#matches). See matches for curried version.
9
+
10
+
Checks whether the given object matches the given pattern. Each primitive value (int, boolean, string, etc.) in the pattern should be same as the corresponding value in the object (deeply) and all conditions (functions) should be satisfied for a match.
11
+
12
+
<details>
13
+
<summary>(click for more)</summary>
14
+
15
+
### Arguments:
16
+
-`pattern`: The pattern object to be matched against the data.
17
+
It's values can be either a value or a function.
18
+
- value: Returns true if all the keys in pattern exist in data and the primitive values of those keys are identical to the data. Object values are compared recursively for inner primitives.
19
+
- function: equality test is performed with corresponding object property. If equality fails, the function will be evaluated with the value of the corresponding property of the data. If function returns true, it will be considered as a match.
0 commit comments