-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Hi !
So I know that Infinity
is not a valid value anymore for zod.number()
, but the default Zod error message that gets thrown is quite confusing:
Invalid input: expected number, received number
I assume it's because it uses typeof
to generate this message
> zod.number().parse(Infinity)
Uncaught ZodError: [
{
"expected": "number",
"code": "invalid_type",
"received": "Infinity",
"path": [],
"message": "Invalid input: expected number, received number"
}
]
at <anonymous>:1:35
> zod.prettifyError(zod.number().safeParse(Infinity).error)
"✖ Invalid input: expected number, received number"
silverwind
Metadata
Metadata
Assignees
Labels
No labels