Cobain
Explore posts from serversAarktype
•Created by Cobain on 10/9/2024 in #questions
Function which receives a arktype's 'type'
I'm trying to do something like this:
But the parsedResponse isn't of type T, so how do I make this function accept as schema anything created using type({...})
13 replies
Aarktype
•Created by Cobain on 9/20/2024 in #questions
Use native ts type
I was wondering if I could use an already created type:
inside an arktype type declaration:
I would go on and create an arktype literal as suggested in the docs, but this type is being declared from another object:
And I want it to be tighly coupled with that object
5 replies
Aarktype
•Created by Cobain on 9/6/2024 in #questions
Represent the File class
Hi! I want to make a schema for validating a form, and one of the elements of the form is going to be a file upload, so I would like to validate that the form is sending an instance of the File class, and then validate that this file size is smaller than a certain amount. Is there a way to represent class instances in Arktype?
An example of doing this in Zod would be:
23 replies