UNPKG

jsshort

Version:

It will make your codes much short and easiar

28 lines (27 loc) 816 B
"use strict"; // conversion.ts Object.defineProperty(exports, "__esModule", { value: true }); exports.array = exports.bool = exports.float = exports.str = exports.int = void 0; // Function to convert a value to an integer exports.int = parseInt; // Function to convert a value to a string exports.str = String; // Function to convert a value to a float (floating-point number) exports.float = parseFloat; // Function to convert a value to a boolean exports.bool = Boolean; // Function to convert a value to an array const array = function (value) { if (Array.isArray(value)) { return value; } else { return [value]; } }; exports.array = array; global.int = exports.int; global.str = exports.str; global.float = exports.float; global.bool = exports.bool; global.array = exports.array;