Function checkAllOf

  • Requires that all of the specified validators are satisfied.

    If any of the specified validators are unsatisfied, the validation error is either the specified validation error or the first invalid validator's error.

    The validationError parameter supports special options:

    • "use-first-error" - The first error is used, using the same order as checkers. See USE_FIRST_ERROR
    • "use-last-error" - The last error is used, using the same order as checkers. See USE_LAST_ERROR
    • string - An error
    • function - A function that produces a validation error, which can be used, for example, to combine the results

    Note that if validationError is "use-last-error" or if it's a function, then computation won't stop on the first error, which could impact performance.

    Type Parameters

    • T

    Parameters

    Returns ValidationCheckerFunction<T>

Generated using TypeDoc