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
-
Is there a way to get the internals of a record? Something like
shape
forobject
orelement
forarray
?For example I want to get
ZodString
fromschema
ofconst schema = z.record(z.string())
Beta Was this translation helpful? Give feedback.
All reactions