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.
1120
+
*
1121
+
* [Read the documentation for `P.object.exact()` on GitHub](https://github.com/gvergnaud/ts-pattern#pobjectexact)
1122
+
*
1123
+
* @example
1124
+
* match(value)
1125
+
* .with(
1126
+
* P.object.exact({ a: P.any }),
1127
+
* () => 'Objects with a single `a` key that contains anything.'
|([arrays]extends[never] ? never : ArrayPattern<arrays>);
171
172
172
-
typeObjectLiteralPattern<a>=
173
+
exporttypeObjectLiteralPattern<a>=
173
174
|{
174
175
readonly[kinkeyofa]?: Pattern<a[k]>;
175
176
}
@@ -684,6 +685,22 @@ export type ObjectChainable<
684
685
* .with(P.object.empty(), () => 'will match on empty objects')
685
686
*/
686
687
empty: ()=>EmptyObjectPattern;
688
+
689
+
/**
690
+
* `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.
691
+
*
692
+
* [Read the documentation for `P.object.exact()` on GitHub](https://github.com/gvergnaud/ts-pattern#pobjectexact)
693
+
*
694
+
* @example
695
+
* match(value)
696
+
* .with(
697
+
* P.object.exact({ a: P.any }),
698
+
* () => 'Objects with a single `a` key that contains anything.'
0 commit comments