advanced-js-kit
Version:
Modern TypeScript utility library with tree-shaking support - Array, String, Number, Network, Sleep, and JWT utilities for JavaScript and TypeScript projects
22 lines (20 loc) • 864 B
TypeScript
/**
* Clamps a number within the inclusive lower and upper bounds
* @param number - The number to clamp
* @param lower - The lower bound
* @param upper - The upper bound
* @returns The clamped number
*/
declare function clamp(number: number, lower: number, upper: number): number;
/**
* Checks if a number is within the inclusive range
* @param number - The number to check
* @param lower - The lower bound
* @param upper - The upper bound
* @returns True if the number is within the range
*/
declare function inRange(number: number, lower: number, upper: number): boolean;
declare const convertToInt: (data: any) => number;
declare const convertToTwoDecimalInt: (data: any) => number;
declare const randomNumberWithFixedLength: (length: number) => number;
export { clamp, convertToInt, convertToTwoDecimalInt, inRange, randomNumberWithFixedLength };