7 lines
156 B
JavaScript
7 lines
156 B
JavaScript
|
const wrap = (min, max, v) => {
|
||
|
const rangeSize = max - min;
|
||
|
return ((((v - min) % rangeSize) + rangeSize) % rangeSize) + min;
|
||
|
};
|
||
|
|
||
|
export { wrap };
|