Nightmarish Pawnshop Mystic
Unleash awesomeness. Private packages, team management tools, and powerful integrations. Get started with npm Orgs »

clamp

1.0.1 • Public • Published

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.

install

npm i clamp

Downloadsweekly downloads

139,006

version

1.0.1

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability