Function maxLength

  • Create a validator that checks if the string is no more than n characters long.

    Returns

    A validator that checks if the string is at most n characters long.

    Parameters

    • n: number

      The maximum length of the string.

    • message: string | MessageResolver<number>

      The error message to use if the string is too long.

    Returns Validator<string>

Generated using TypeDoc