Skip to main content
Module

x/fuzzy_octo_guacamole/mod.ts>Pattern.not

A playground for testing CI setup that deploys on Deno and NPM
Go to Latest
function Pattern.not
import { Pattern } from "https://deno.land/x/fuzzy_octo_guacamole@v2.0.0/mod.ts";
const { not } = Pattern;

P.not(pattern) returns a pattern which matches if the sub pattern doesn't match.

Read P.not documentation on GitHub

Examples

match<{ a: string | number }>(value) .with({ a: P.not(P.string) }, (x) => 'will match { a: number }' )

Type Parameters

input
p extends unknown extends input ? UnknownPattern : Pattern<input> | undefined

Parameters

pattern: p