Skip to content

assertcheck v1.0.0


assertcheck / assert / number

Function: number()

ts
function number(v, opts?): asserts v is number;

Defined in: src/assert.ts:215

Asserts that v is a number. Narrows the type after the call.

Parameters

ParameterType
vunknown
opts?Opts

Returns

asserts v is number

Example

ts
`assert.number(price, "price must be a number")`

Released under the Apache 2.0 License. Built by Vagabond Studio — senior-only for growing companies.