Skip to main content
Module

x/fuzzy_octo_guacamole/patterns.ts>union

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

P.union(...patterns) returns a pattern which matches if at least one of the patterns provided in parameter match the input.

Read P.union documentation on GitHub

Examples

match(value) .with( { type: P.union('a', 'b', 'c') }, ({ user }) => 'will match { type: "a" | "b" | "c" }' )

Type Parameters

input
ps extends unknown extends input ? [UnknownPattern, ...UnknownPattern[]] : [Pattern<input>, ...Pattern<input>[]]

Parameters

...patterns: ps