Closed calvinl closed 3 years ago
You can do v.object({}).additional(true)
. This is a shortcut for v.object({}).additional(v.any())
which creates a type identical to Record<string, any>
. There is no unknown
support yet, perhaps that's a good addition to add - it's certainly more safe than any
.
Thanks for the feedback, and sorry for not having any API documentation yet. It's coming!
Thank you!
Just noting here that the killer feature is converting to JSON schema for me. I came from previously using zod which has great typescript support (including the nested compilation mentioned in #5). I had written a custom zodToJsonSchema converter but it's not quite as robust as suretype.
Thanks again! Closing this ticket.
Hi there,
This project looks really promising! I was wondering if there was a way to provide a loose record schema that may have arbitrary keys/values. Basically the typescript equivalent of
Record<string, unknown>
?Thanks for the great work on this!