gunshi / combinators / number
Function: number()
ts
function number(opts?): CombinatorSchema<number>;Experimental
Create a number argument schema with optional range validation.
Accepts any numeric value (integer or float).
Parameters
| Parameter | Type | Description |
|---|---|---|
opts? | NumberOptions | Range options. |
Returns
CombinatorSchema<number>
A combinator schema that resolves to number.
Example
ts
const args = {
timeout: number({ min: 0, max: 30000 })
}