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

Function BigInt

packages/effect/src/SchemaGetter.ts:1011–1025  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1009 * @since 4.0.0
1010 */
1011export function BigInt<E extends string | number | bigint | boolean>(): Getter<bigint, E> {
1012 return transformEffect((input, options) => {
1013 try {
1014 return Effect.succeed(globalThis.BigInt(input))
1015 } catch {
1016 return Effect.fail(
1017 new SchemaIssue.InvalidValue(
1018 { expected: "a value that can be converted to a bigint" },
1019 input,
1020 options
1021 )
1022 )
1023 }
1024 })
1025}
1026
1027/**
1028 * Coerces a value to a `Date` using `new Date(input)`.

Callers

nothing calls this directly

Calls 3

transformEffectFunction · 0.70
failMethod · 0.65
succeedMethod · 0.45

Tested by

no test coverage detected