Replies: 1 comment
-
Turns out I've been a bit tricked. I'm using Typebox alongside ElysiaJS, and Elysia overrides certain types from Typebox as it also extends some base functionality. The TS suggestions probably come from there. I suppose the formats themselves also come from Ajv in the end. Though I haven't used Ajv, I think that pretty much just answers my question anyway, so I'll close this. |
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
-
Since TypeScript suggested to me that
Type.String({ format: "" })
could take on a set of values, such asemail
anddate-time
, I didn't know I needed to configure these beforehand.Anyhow, doing so isn't really a problem, but it is a bit of boilerplate to copy the files from the
/example/formats
folder. Maybe this was intended to be done very differently.If not, I was just wondering if there's a package that already sets up these default formats. Sounds to me like something that could be useful as an optional additional package, if not included as a tree-shakable submodule in the main package.
Something akin to
(or
"@sinclair/typebox/formats"
)But before I get ahead of myself, I assume there's a reason why this isn't done?
Beta Was this translation helpful? Give feedback.
All reactions