The value to clamp.
The lower bound.
The upper bound.
The value clamped to [min, max].
import { clamp } from '@untemps/utils/number/clamp'clamp(5, 0, 10) // 5clamp(-3, 0, 10) // 0clamp(15, 0, 10) // 10clamp(5, 10, 0) // 5 (reversed min/max is normalized) Copy
import { clamp } from '@untemps/utils/number/clamp'clamp(5, 0, 10) // 5clamp(-3, 0, 10) // 0clamp(15, 0, 10) // 10clamp(5, 10, 0) // 5 (reversed min/max is normalized)
The value to clamp.