Skip to content
Functioncorev0.12.0

or

Runs each gate in order and passes on the first gate that passes. Takes two or more gates. The required context is the union of their contexts. A handler that matches any one gate fits. When every gate 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 a gate.

See also:and

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

Gates

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

Gates

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

gates

gates: Gates

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