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

Defined in

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>

Defined in

isObject.ts:9