unnreaal
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
.optional is in ZodType, no?
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
or at least warn users
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
zod should throw an error
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
bro, i edited the message (before you send the playground link)
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
try yourself
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
it is
{ name?: string | undefined; }
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
im sure it isnt
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
nop
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
so zod should throw an error warning the optional can not (or is unnecessary) be used with coerce schemas
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
but the
name
is always a string here37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
i mean that the type is completely wrong
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
yes bro, i know the
| undefined
doesn't mean anything for z.coerce
schemas37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
no, i mean that the type (
z.output
) is wrong37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
no?
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
its a type error
37 replies
ZZod
•Created by unnreaal on 11/4/2024 in #questions
unnreaal - tsconst schema = z.coerce.string()....
still the same with
z.output
37 replies
ZZod
•Created by Whimsy on 9/2/2024 in #questions
Whimsy - .optional() makes the type optional? l...
you don't need to use
.optional
when using .default
@Whimsy9 replies