janglad
ZZod
•Created by Haddok on 11/10/2024 in #questions
Haddok - hi , i have defined a schema where i a...
Cause yea you’ll have to type these as being a key off shape and possibly do some casting
4 replies
ZZod
•Created by Haddok on 11/10/2024 in #questions
Haddok - hi , i have defined a schema where i a...
With an error, I assume you mean a Typescript one?
4 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
yea that one would have a stack trace if I have it right
15 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
no formatted error is fine!
15 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
aah shit sorry completely misread that
15 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
but also FYI if this is for typing a back end endpoint, you can't really serialise Errors (and shouldn't really try to either as they have info like the stack trace that shouldn't make it to the client)
15 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
In that case just type it as such, probably best using a discriminated union like
{code: "INPUT_PARSING" , error: z.ZodError...} | {code: "UNCAUGHT", error: unknown}
15 replies
ZZod
•Created by Z4RM on 9/23/2024 in #questions
Z4RM - Hello! I'm going to write a fullstack ap...
if you're not going to trust the error coming out of Zod why trust the parsing it's doing
15 replies