Function: isInstanceOf()
ts
function isInstanceOf<T>(
value: unknown,
type: string,
ctor?: (...args: any[]) => T,
): value is T;Checks if a value is an instance of a specific class.
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type | Description |
|---|---|---|
value | unknown | The value to check |
type | string | The name of the class to check against |
ctor? | (...args: any[]) => T | - |
Returns
value is T
true if the value is an instance of the specified class, false otherwise