clamp
Clamp a value between two other values
Last updated 6 years ago by hughsk .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm 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 (6 years ago)

3 Versions

  • 1.0.1                                ...           6 years ago
  • 1.0.0                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 6
This Week 536
This Month 6,106
Last Day 530
Last Week 2,617
Last Month 13,304
Dependencies (0)
None
Dev Dependencies (1)
Dependents (248)

Copyright 2014 - 2017 © taobao.org |