effect-io-ai

Package: effect
Module: BigInt

BigInt.BigInt

Exposes the global bigint constructor for JavaScript bigint coercion.

When to use

Use to access native JavaScript bigint constructor coercion from the Effect module namespace.

Gotchas

This follows native BigInt coercion rules. It throws for invalid strings or non-integral numbers, and whitespace-only strings coerce to 0n.

See

Example (Constructing bigints)

import { BigInt } from "effect"

const bigInt = BigInt.BigInt(123)
console.log(bigInt) // 123n

const fromString = BigInt.BigInt("456")
console.log(fromString) // 456n

Signature

declare const BigInt: BigIntConstructor

Source

Since v4.0.0