effect-io-ai

Package: effect
Module: SchemaGetter

SchemaGetter.Boolean

Coerces any value to a boolean using the global Boolean() constructor.

When to use

Use when you need a schema getter to coerce a present encoded value to a boolean with Boolean().

Details

The getter is pure, never fails, and delegates to globalThis.Boolean.

Example (Coercing to a boolean)

import { SchemaGetter } from "effect"

const toBool = SchemaGetter.Boolean<string>()
// Getter<boolean, string>

Signature

declare const Boolean: <E>() => Getter<boolean, E>

Source

Since v4.0.0