Skip to content

Commit

Permalink
feat(P.Pattern): support no type param
Browse files Browse the repository at this point in the history
  • Loading branch information
gvergnaud committed Dec 15, 2024
1 parent 16e2b2c commit a009d89
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/types/Pattern.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,9 @@ export type UnknownPattern =
* @example
* const pattern: P.Pattern<User> = { name: P.string }
*/
export type Pattern<a> = unknown extends a ? UnknownPattern : KnownPattern<a>;
export type Pattern<a = unknown> = unknown extends a
? UnknownPattern
: KnownPattern<a>;

type KnownPattern<a> = KnownPatternInternal<a>;

Expand Down

0 comments on commit a009d89

Please sign in to comment.