UNPKG

diginext-utils

Version:
18 lines 468 B
/** * Clamps a number between a minimum and maximum value. * Returns 0 if the result is not finite. * * @param value - The value to clamp * @param min - The minimum value * @param max - The maximum value * @returns The clamped value * * @example * ```ts * clamp(15, 0, 10); // 10 * clamp(-5, 0, 10); // 0 * clamp(5, 0, 10); // 5 * ``` */ export declare function clamp(value: number, min: number, max: number): number; //# sourceMappingURL=clamp.d.ts.map