clamp
Clamp a value between two other values
Last updated 11 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install clamp 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 1.0.1                                ...           latest (11 years ago)

3 Versions

  • 1.0.1                                ...           11 years ago
  • 1.0.0                                ...           11 years ago
  • 0.0.0                                ...           11 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 3
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |