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

Function makeZodObj

packages/zod/src/v4/classic/tests/object.test.ts:624–628  ·  view source on GitHub ↗
(key: T)

Source from the content-addressed store, hash-verified

622
623test("index signature in shape", () => {
624 function makeZodObj<const T extends string>(key: T) {
625 return z.looseObject({
626 [key]: z.string(),
627 });
628 }
629
630 const schema = makeZodObj("foo");
631 type schema = z.infer<typeof schema>;

Callers 1

object.test.tsFile · 0.85

Calls 1

stringMethod · 0.80

Tested by

no test coverage detected