@zzzzbov/clamp
v0.0.0
Published
The `clamp` function takes a minimum bound, a value, and a maximum bound and returns the value clamped between the two bounds.
Downloads
1
Readme
clamp
The clamp
function takes a minimum bound, a value, and a maximum bound and returns the value clamped between the two bounds.
Example
const min = clamp(1, 0, 5); // 1 const value = clamp(1, 3, 5); // 3 const max = clamp(1, 10, 5); // 5