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
* `P.object.exact({...})` matching objects that contain exactly the set of defined in the pattern. Objects with additional keys won't match this pattern, even if keys defined in both the pattern and the object match.
1135
+
*
1136
+
* [Read the documentation for `P.object.exact()` on GitHub](https://github.com/gvergnaud/ts-pattern#pobjectexact)
1137
+
*
1138
+
* @example
1139
+
* match(value)
1140
+
* .with(
1141
+
* P.object.exact({ a: P.any }),
1142
+
* () => 'Objects with a single `a` key that contains anything.'
|([arrays]extends[never] ? never : ArrayPattern<arrays>);
166
167
167
-
typeObjectLiteralPattern<a>=
168
+
exporttypeObjectLiteralPattern<a>=
168
169
|{
169
170
readonly[kinkeyofa]?: Pattern<a[k]>;
170
171
}
@@ -681,6 +682,22 @@ export type ObjectChainable<
681
682
* .with(P.object.empty(), () => 'will match on empty objects')
682
683
*/
683
684
empty: ()=>EmptyObjectPattern;
685
+
686
+
/**
687
+
* `P.object.exact({...})` matching objects that contain exactly the set of defined in the pattern. Objects with additional keys won't match this pattern, even if keys defined in both the pattern and the object match.
688
+
*
689
+
* [Read the documentation for `P.object.exact()` on GitHub](https://github.com/gvergnaud/ts-pattern#pobjectexact)
690
+
*
691
+
* @example
692
+
* match(value)
693
+
* .with(
694
+
* P.object.exact({ a: P.any }),
695
+
* () => 'Objects with a single `a` key that contains anything.'
0 commit comments