mirror of
https://github.com/CorentinTh/it-tools.git
synced 2025-07-18 20:59:37 +02:00
6 lines
162 B
TypeScript
6 lines
162 B
TypeScript
|
function clamp({ value, min = 0, max = 100 }: { value: number; min?: number; max?: number }) {
|
||
|
return Math.min(Math.max(value, min), max);
|
||
|
}
|
||
|
|
||
|
export { clamp };
|