Skip to main content
Module

x/fuzzy_octo_guacamole/mod.ts>Pattern.union

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

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

Read the documentation for P.union on GitHub

Examples

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

Type Parameters

input
ps extends readonly [Pattern<input>, ...Pattern<input>[]]

Parameters

...patterns: ps

Returns

Chainable<OrP<input, ps>>