Skip to content

Collection of handy online tools for developers, with great UX.

162 B
Raw Blame
function clamp({ value, min = 0, max = 100 }: { value: number; min?: number; max?: number }) {
  return Math.min(Math.max(value, min), max);
}

export { clamp };