(key: T)
| 622 | |
| 623 | test("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>; |