(input: unknown): input is { [x: PropertyKey]: unknown } | Array<unknown>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([]))Source effect/Predicate.ts:10013 lines
export function function isObjectOrArray(
input: unknown
): input is
| {
[x: PropertyKey]: unknown
}
| Array<unknown>
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([]))
isObjectOrArray(input: unknowninput: unknown): input: unknowninput is { [x: PropertyKeyx: type PropertyKey =
| string
| number
| symbol
PropertyKey]: unknown } | interface Array<T>Array<unknown> {
return typeof input: unknowninput === "object" && input: object | nullinput !== null
}