Files
OpenCut/apps/web/src/utils/math.ts
T
2026-01-31 00:20:04 +01:00

12 lines
153 B
TypeScript

export function clamp({
value,
min,
max,
}: {
value: number;
min: number;
max: number;
}): number {
return Math.max(min, Math.min(max, value));
}