MCPcopy Create free account
hub / github.com/Effect-TS/effect / fromString

Function fromString

packages/effect/src/BigInt.ts:850–858  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

848 * @since 2.4.12
849 */
850export const fromString = (s: string): Option.Option<bigint> => {
851 try {
852 return s.trim() === ""
853 ? Option.none()
854 : Option.some(BigInt(s))
855 } catch {
856 return Option.none()
857 }
858}
859
860/**
861 * Converts a number to a `bigint`.

Callers

nothing calls this directly

Calls 2

someMethod · 0.80
BigIntInterface · 0.70

Tested by

no test coverage detected