3 lines
112 B
TypeScript
3 lines
112 B
TypeScript
export function clamp(v: number, min: number, max: number): number {
|
|
return Math.min(max, Math.max(min, v))
|
|
}
|