Function makeInstanceOfValidator

  • Creates a new validator function which checks whether an input value is an instance of a given class. Doesn't stop the validator chain.

    Type Parameters

    • T

    Parameters

    • clazz: (new (...args: unknown[]) => T)
        • new (...args): T
        • Parameters

          • Rest...args: unknown[]

          Returns T

    Returns ((inputValue: unknown) => [value: T, stop: boolean])

      • (inputValue): [value: T, stop: boolean]
      • Parameters

        • inputValue: unknown

        Returns [value: T, stop: boolean]