<T>(value?: T): booleanExposes the global boolean constructor for JavaScript truthiness coercion.
When to use
Use to access native JavaScript truthiness coercion from the Effect module namespace.
Gotchas
This follows native truthiness rules. For example, non-empty strings such as
"false" coerce to true.
Example (Coercing values to booleans)
import { Boolean } from "effect"
const bool = Boolean.Boolean(1)
console.log(bool) // true
const fromString = Boolean.Boolean("false")
console.log(fromString) // true (non-empty string)
const fromZero = Boolean.Boolean(0)
console.log(fromZero) // falseconstructors
Source effect/Boolean.ts:501 lines
export const const Boolean: BooleanConstructorExposes the global boolean constructor for JavaScript truthiness
coercion.
When to use
Use to access native JavaScript truthiness coercion from the Effect module
namespace.
Gotchas
This follows native truthiness rules. For example, non-empty strings such as
"false" coerce to true.
Example (Coercing values to booleans)
import { Boolean } from "effect"
const bool = Boolean.Boolean(1)
console.log(bool) // true
const fromString = Boolean.Boolean("false")
console.log(fromString) // true (non-empty string)
const fromZero = Boolean.Boolean(0)
console.log(fromZero) // false
Boolean = module globalThisglobalThis.var Boolean: BooleanConstructorBoolean