Clamp a value between two other values.
JavaScript
Latest commit 377851f Jul 30, 2014 @hughsk 1.0.1
Permalink
Failed to load latest commit information.
.gitignore Add gitignore Jul 28, 2014
LICENSE.md first commit Oct 16, 2013
README.md update stability to frozen Oct 16, 2013
index.js first commit Oct 16, 2013
package.json 1.0.1 Jul 29, 2014
test.js first commit Oct 16, 2013

README.md

clamp frozen

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.

Usage

clamp

clamp(value, a, b)

Returns value, if it is between a and b. Otherwise, returns the number it's gone past.

License

MIT. See LICENSE.md for details.