3 lines
112 B
TypeScript
3 lines
112 B
TypeScript
export const clamp = (val: number, min: number, max: number) => {
|
|
return Math.max(min, Math.min(val, max));
|
|
}; |