Integer type caster module for JavaScript/TypeScript.
npm i @jellybeanci/index
// ES6 Syntax
import {index} from "@jellybeanci/index";
// Commonjs Syntax
const {index} = require("@jellybeanci/index");
// Commonjs with custom name
const integer = require("@jellybeanci/index").index;
const integerNumber = index(floatingPointNumber);
const parsedIntegerNumber = index(stringNumber);
console.log(index(3.1415)); // 3
console.log(index(-6.2342)); // -6
console.log(index("25.3")); // 25
console.log(index("not a number")); // 0
type intFunctionType = (numberValue: number | string) => number;