effect-io-ai

Package: effect
Module: Predicate

Predicate.isBoolean

Checks whether a value is a boolean.

When to use

Use when you need a Predicate guard to narrow an unknown value to a boolean.

Details

Uses typeof input === "boolean".

Example (Guarding booleans)

import { Predicate } from "effect"

const data: unknown = true

if (Predicate.isBoolean(data)) {
  console.log(data ? "yes" : "no")
}

See

Signature

declare const isBoolean: (input: unknown) => input is boolean

Source

Since v2.0.0