Skip to main content

Function: isObject()

Call Signature

isObject(input: unknown, constructorType?: ObjectConstructor): input is object

Defined in: isObject.ts:8

Verify if the input is an object literal (or class).

Parameters

ParameterTypeDescription
inputunknownThe object to verify
constructorType?ObjectConstructorThe type of the constructor of the object. Use this if you want a class of your choosing to pass the check as well.

Returns

input is object

Call Signature

isObject<T>(input: unknown, constructorType: T): input is InstanceType<T>

Defined in: isObject.ts:9

Verify if the input is an object literal (or class).

Type Parameters

Type Parameter
T extends Constructor<unknown>

Parameters

ParameterTypeDescription
inputunknownThe object to verify
constructorTypeTThe type of the constructor of the object. Use this if you want a class of your choosing to pass the check as well.

Returns

input is InstanceType<T>