Function isInstanceOf

  • Wraps the JavaScript built-in "instanceof" in a type guard.

    Type Parameters

    • InstanceType

    Parameters

    • instance: unknown

      The value to check.

    • classConstructor: Constructor<InstanceType>

      The constructor that the "instance" input will be checked against.

    Returns instance is InstanceType