effect-io-ai

Package: effect
Module: Predicate

Predicate.isObjectOrArray

Checks whether a value is an object or an array (non-null object).

When to use

Use when you need a Predicate guard that accepts plain objects and arrays, but not null.

Details

Uses typeof input === "object" && input !== null and includes arrays.

Example (Checking objects or arrays)

import { Predicate } from "effect"

console.log(Predicate.isObjectOrArray([]))

See

Signature

declare const isObjectOrArray: (input: unknown) => input is { [x: PropertyKey]: unknown; } | Array<unknown>

Source

Since v4.0.0