This schema only accepts finite numbers for safety. If you need full control over your number, use unsafeNumber instead.
unsafeNumber
Basically, it accepts anything passing the check Number.isFinite.
Number.isFinite
import * as x from 'unhoax'x.number.parse(1) // { success: true, value: 1 } Copy
import * as x from 'unhoax'x.number.parse(1) // { success: true, value: 1 }
This schema only accepts finite numbers for safety.
If you need full control over your number, use
unsafeNumber
instead.Basically, it accepts anything passing the check
Number.isFinite
.