Function validateAll

  • Validate an input's fields with validators

    Type Parameters

    • T

      The validated type

    Parameters

    Returns Validator<T[]>

    Example

    validateAll(isNumber)([1, 2, 3]) >>
    {
    valid: true,
    parsed: [1, 2, 3],
    };

    validateAll(isNumber)(["1", 2, "3"]) >>
    {
    valid: false,
    error: ['Not a number: "1"', 'Not a number: "3"'],
    };