Skip to content

assertcheck v1.0.0


assertcheck / assert / integer

Function: integer() ​

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

Defined in: src/assert.ts:242

Asserts that v is a finite integer (no floats, no NaN, no Infinity).

Parameters ​

ParameterType
vunknown
opts?Opts

Returns ​

asserts v is number

Example ​

ts
`assert.integer(amountCents, "amount must be integer cents")`

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