Skip to main content

Function: isObject()

isObject(input, constructorType)

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

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

Source

lib/isObject.ts:8

isObject(input, constructorType)

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

Type parameters

Type parameter
T extends Constructor<unknown>

Parameters

ParameterType
inputunknown
constructorTypeT

Returns

input is InstanceType<T>

Source

lib/isObject.ts:9