P.not(pattern) returns a pattern which matches if the sub pattern doesn't match.
P.not(pattern)
Read the documentation for P.not on GitHub
P.not
match<{ a: string | number }>(value) .with({ a: P.not(P.string) }, (x) => 'will match { a: number }' ) Copy
match<{ a: string | number }>(value) .with({ a: P.not(P.string) }, (x) => 'will match { a: number }' )
P.not(pattern)
returns a pattern which matches if the sub pattern doesn't match.Read the documentation for
P.not
on GitHub