Package Exports
- clamp-v2
- clamp-v2/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (clamp-v2) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
clamp-v2
Clamp a value between two bounds.
Installation
pnpm add clamp-v2Usage
import clamp from "clamp-v2";
clamp(1, 5, 10); // => 5
clamp(20, 5, 10); // => 10
clamp(8, 5, 10); // => 8API
clamp(value, min, max)
Clamp a number between two given minimum and maximum bound.
Parameters:
1. value
Type:
number
The number to be clamped.
2. min
Type:
number
The minimum bound.
3. max
Type:
number
The maximum bound.