(input: unknown): input is { [x: PropertyKey]: unknown }Checks whether a value is a non-null object value that is not an array.
When to use
Use to narrow unknown input to a non-null, non-array object with a
Predicate guard.
Details
This is a structural runtime check using typeof input === "object", so it
also accepts object instances such as Date, Map, class instances, and
typed arrays. It excludes null and arrays.
Example (Guarding objects)
import { Predicate } from "effect"
console.log(Predicate.isObject({ a: 1 }))
console.log(Predicate.isObject([1, 2]))export function function isObject(
input: unknown
): input is {
[x: PropertyKey]: unknown
}
Checks whether a value is a non-null object value that is not an array.
When to use
Use to narrow unknown input to a non-null, non-array object with a
Predicate guard.
Details
This is a structural runtime check using typeof input === "object", so it
also accepts object instances such as Date, Map, class instances, and
typed arrays. It excludes null and arrays.
Example (Guarding objects)
import { Predicate } from "effect"
console.log(Predicate.isObject({ a: 1 }))
console.log(Predicate.isObject([1, 2]))
isObject(input: unknowninput: unknown): input: unknowninput is { [x: PropertyKeyx: type PropertyKey =
| string
| number
| symbol
PropertyKey]: unknown } {
return typeof input: unknowninput === "object" && input: object | nullinput !== null && !var Array: ArrayConstructorArray.ArrayConstructor.isArray(arg: any): arg is any[]isArray(input: objectinput)
}