P.union(...patterns) returns a pattern which matches if at least one of the patterns provided in parameter match the input.
P.union(...patterns)
Read the documentation for P.union on GitHub
P.union
Rest
match(value) .with( { type: P.union('a', 'b', 'c') }, ({ type }) => 'will match { type: "a" | "b" | "c" }' ) Copy
match(value) .with( { type: P.union('a', 'b', 'c') }, ({ type }) => 'will match { type: "a" | "b" | "c" }' )
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