Instance Method

or(_:)

Produces a new Validator by combining self with another validator using “or” logic.

Declaration

func or<V>(_ other: V) -> Validator<Self.T> where V : ValidatorExpressible, Self.T == V.T

Return Value

A new Validator.

Parameters

other

A Validator to combine with self.

Discussion

The resulting validator only fails if both validators fail. Failures from both validators are combined.