package
Clamp a value between two other values
npm install clampGitHub-flavored package documentation.
Across all versions, last 30 days.
4,588,701 in 30 days
Runtime metadata.
Tagged topics.
Clamp a value between two other values. It's as simple as modules come - saving keystrokes because I've had to write this function too many times.
clamp(value, a, b)Returns value, if it is between a and b. Otherwise, returns the number
it's gone past.
MIT. See LICENSE.md for details.