Function requireNeeded

  • Constructs input validator that filters validation messages from the given validators according to their codes.

    The validation messages reported by validators are filtered according to the following rules:

    • If at least one message with missing code is reported, then strip out the ones with incomplete and invalid codes, except the ones with despiteMissing code.
    • Otherwise, if at least one message with incomplete code is reported, then strip out the ones with invalid code, except the ones with despiteIncomplete code.
    • Otherwise report all messages.

    Type Parameters

    • TValue

      Input value type.

    Parameters

    • Rest ...validators: InValidator<TValue>[]

      Validators to validate the input with.

    Returns InValidator<TValue>

    Validator that requires all the given validators and filters their output.

Generated using TypeDoc