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

Function numberToBigInt

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

Source from the content-addressed store, hash-verified

93// ============================================================================
94
95const numberToBigInt = () =>
96 z.codec(z.int(), z.bigint(), {
97 decode: (num) => BigInt(num),
98 encode: (bigint) => Number(bigint),
99 });
100
101test("numberToBigInt codec", () => {
102 const codec = numberToBigInt();

Callers 1

Calls 2

bigintMethod · 0.80
intMethod · 0.65

Tested by

no test coverage detected