A
arktype•2mo ago
ns45766

type.declare composition with undefined

Hello, I've been playing with arktype and trying to compose validators using preexisting types with type.declare .
When adding undefined this falls apart during compilation. https://stackblitz.com/edit/vitejs-vite-cpr8tkpa?file=src%2Fmain.ts Is there a better way to handle this? Thanks in advance.
nino.nikola.stanusic@microblink.com
StackBlitz
Vitejs - Vite (duplicated) - StackBlitz
Next generation frontend tooling. It's fast!
3 Replies
ssalbdivad
ssalbdivad•2mo ago
interesting this does look like a bug declare is going to be formally published and announced as part of 2.2 coming up, would you be able to log an issue so I can track fixing this before then?
ns45766
ns45766OP•2mo ago
Sure thing
ns45766
ns45766OP•2mo ago
https://github.com/arktypeio/arktype/issues/1537 I've added an issue to github, thanks for taking the time 🙂
GitHub
arktypeio/arktype
TypeScript's 1:1 validator, optimized from editor to runtime - arktypeio/arktype

Did you find this page helpful?