Function createLengthValidator

  • Creates a function that validates if the length of the input is equal to the specified length. The returned function accepts any value with a 'name' property and is named 'isLengthOf' concatenated with the specified length.

    Parameters

    • length: number

      The length to validate against.

    Returns ((input) => boolean)

      • (input): boolean
      • Parameters

        • input: unknown

        Returns boolean

    Throws

    if length is not an integer.

Generated using TypeDoc