everyutil
Version:
A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.
11 lines (10 loc) • 450 B
TypeScript
/**
* Wraps a number in a circular range [min, max].
* For example, wrapNumber(11, 0, 10) returns 1.
* @author @dailker
* @param {number} n - The input number to wrap.
* @param {number} min - The minimum value of the range.
* @param {number} max - The maximum value of the range.
* @returns {number} The wrapped number within the range [min, max].
*/
export declare function wrapNumber(n: number, min: number, max: number): number;