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

Function hexToBytes

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

Source from the content-addressed store, hash-verified

359// ============================================================================
360
361const hexToBytes = () =>
362 z.codec(z.hex(), z.instanceof(Uint8Array), {
363 decode: (hexString) => z.util.hexToUint8Array(hexString),
364 encode: (bytes) => z.util.uint8ArrayToHex(bytes),
365 });
366
367test("hexToBytes codec", () => {
368 const codec = hexToBytes();

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected