MCPcopy Create free account
hub / github.com/effect-app/libs / fromString

Function fromString

repos/effect/packages/effect/src/BigInt.ts:872–880  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

870 * (`Number.MAX_SAFE_INTEGER` and `Number.MIN_SAFE_INTEGER`) or if the number is
871 * not a valid `bigint`, it returns `Option.none()`.
872 *
873 * **Example** (Converting numbers to bigints)
874 *
875 * ```ts import.meta.vitest
876 * import { BigInt, Option } from "effect"
877 *
878 * BigInt.fromNumber(42) // => Option.some(42n)
879 * BigInt.fromNumber(Number.MAX_SAFE_INTEGER + 1) // => Option.none()
880 * BigInt.fromNumber(Number.MIN_SAFE_INTEGER - 1) // => Option.none()
881 * ```
882 *
883 * @see {@link toNumber} for converting `bigint` values back to safe integer numbers

Callers

nothing calls this directly

Calls 2

someMethod · 0.80
BigIntInterface · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…