pure-parse
Version:
Strongly typed validation library that decouples type aliases from validation logic
14 lines (13 loc) • 419 B
TypeScript
import { Guard } from './Guard';
/**
* Returns a guard that checks whether the data is an instance of the given constructor.
* @example
* ```ts
* const isError = instanceOfGuard(Error)
* isError(new Error()) // -> true
* ```
* @param constructor the right-hand side argument of the `instanceof` operator
*/
export declare const instanceOfGuard: <T>(constructor: {
new (...args: never[]): T;
}) => Guard<T>;