MCPcopy
hub / github.com/colinhacks/zod / stringToBigInt

Function stringToBigInt

packages/zod/src/v4/classic/tests/codec-examples.test.ts:66–70  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

64// ============================================================================
65
66const stringToBigInt = () =>
67 z.codec(z.string(), z.bigint(), {
68 decode: (str) => BigInt(str),
69 encode: (bigint) => bigint.toString(),
70 });
71
72test("stringToBigInt codec", () => {
73 const codec = stringToBigInt();

Callers 1

Calls 3

stringMethod · 0.80
bigintMethod · 0.80
toStringMethod · 0.80

Tested by

no test coverage detected