aboutsummaryrefslogtreecommitdiff
path: root/src/util/number.ts
blob: 87f1e2ed21c03b48e875025f7fa4b0169e5edde0 (plain)
1
2
3
export function clamp(x: number, min: number, max: number): number {
  return Math.max(min, Math.min(max, x))
}