GuobaGuoba Utils

isObject

@guoba-ai/utils / guard / isObject

Function: isObject()

function isObject(val): val is Record<string, any>;

Defined in: guard.ts:58

Check if a value is a plain object (not an array or null).

Parameters

val

unknown

The value to check

Returns

val is Record<string, any>

true if the value is a plain object

Example

isObject({ a: 1 }) // true
isObject([1, 2]) // false
isObject(null) // false

On this page