Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dictionary type: unknown keys but known values #28

Closed
itsMapleLeaf opened this issue Apr 4, 2020 · 2 comments
Closed

Dictionary type: unknown keys but known values #28

itsMapleLeaf opened this issue Apr 4, 2020 · 2 comments

Comments

@itsMapleLeaf
Copy link

I've looked through the docs, but I'm unclear on how to achieve a dictionary type that has unknown string keys, but known values, basically the type of Record<string, KnownType | undefined>. The nostrict() modifier is close, but I don't see how to specify the value type when using that

@colinhacks
Copy link
Owner

This is under development now, should be published by the end of the day

@colinhacks
Copy link
Owner

This has been published in zod@1.1.2.

The documentation is at https://github.com/vriad/zod#records.

Take it for a spin and let me know if you have any issues. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants