isObject

A TypeScript type guard that checks whether a value is a non-null object, excluding arrays, so property access is narrowed safely.

Usage

Check whether a value is an object ({}), excluding null and arrays. This is a TypeScript type guard function.

import { isObject } from '@movk/core'

isObject({}) // => true
isObject([]) // => false
isObject(null) // => false
isObject('hello') // => false

API

isObject(value: any): value is object

Parameters

value
any required
The value to check.

Returns

boolean
Returns true if the value is an object (and is not null or an array), otherwise false.

Changelog

No recent changes
Copyright © 2024 - 2026 YiXuan - MIT License