instanceOfTypeGuard<T>
Builds a guard accepting an instance of a class, or of a class derived from it.
Import:
import { instanceOfTypeGuard } from '@mnaoumov/typescript-lib/type-guards';Signature:
function instanceOfTypeGuard(constructor: abstract new (...arguments_: never[]) => T): TypeGuard<T>Parameters:
| Parameter | Type | Description |
|---|---|---|
constructor |
abstract new (…arguments_: never[]) => T | The class. |
Returns: TypeGuard<T> — The guard.