or
or<
T>(…choices):TypeWrapper<UnwrapTypes<T>>
Defined in: .work/repos/edinburgh/src/types.ts:737
Create a union type wrapper from multiple type choices.
Type Parameters
Section titled “Type Parameters”T extends (TypeWrapper<unknown> | BasicType)[]
Array of type wrapper or basic types.
Parameters
Section titled “Parameters”choices
Section titled “choices”…T
The type choices for the union.
Returns
Section titled “Returns”TypeWrapper<UnwrapTypes<T>>
A union type instance.
Example
Section titled “Example”const stringOrNumber = E.or(E.string, E.number);const status = E.or("active", "inactive", "pending");