Replies: 2 comments
-
|
Good question. There is a import test from "tape";
import { z } from "zod";
const schema = z.record(z.string());
test("valid", (t) => {
t.true(schema._def.valueType instanceof z.ZodString);
t.end();
}); |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks, that works. Still, I think there should be a public API for that. I'll create an issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to get the internals of a record? Something like
shapeforobjectorelementforarray?For example I want to get
ZodStringfromschemaofconst schema = z.record(z.string())Beta Was this translation helpful? Give feedback.
All reactions