Skip to content
Functioncorev0.10.0

or

Runs each gate in order and passes on the first arm that passes. Takes two or more arms. The required context is the union of the arms. A handler that matches any one arm fits. When every arm refuses it throws the trailing OrOptions fail if given, else a list built from each refusal's summary, else a default refusal. The trailing options object does not count as an arm.

See also:and

or<Gates>(
    gates: Gates
): Gate<
    RequiredOf<Gates[number]>,
    JoinNames<Gates, " | ">
>

Gates

The tuple of two or more gate arms, tried left to right.

Gates

The tuple of two or more gate arms, tried left to right.

gates

gates: Gates

The gate arms to try in order, with an optional trailing OrOptions object.