Const
Casts a number to an Int branded type.
This function validates that the input is an integer and returns it with the Int brand. Throws a TypeError if the value has a fractional component or is not a finite number.
The value as an Int branded type
const branded = asInt(42);assert(branded === 42);assert.ok(Int.is(branded)); Copy
const branded = asInt(42);assert(branded === 42);assert.ok(Int.is(branded));
If the value is not an integer
Casts a number to an Int branded type.
This function validates that the input is an integer and returns it with the Int brand. Throws a TypeError if the value has a fractional component or is not a finite number.