Skip to content

instanceOfGuard<T>

Builds a guard accepting an instance of a class, or of a class derived from it, expecting an instance of the class’s name.

Import:

import { instanceOfGuard } from '@mnaoumov/typescript-lib/api-contract';

Signature:

function instanceOfGuard(constructor: abstract new (...arguments_: never[]) => T): ExpectedTypeGuard<T>

Parameters:

Parameter Type Description
constructor abstract new (…arguments_: never[]) => T The class.

Returns: ExpectedTypeGuard<T> — The guard.