Package: effect
Module: 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
fromString for parsing strings into an OptionfromNumber for converting safe integers into an OptionExample (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
Since v4.0.0