UNPKG
@visx/drag
Version:
alpha (0.0.200-alpha.0)
latest (3.12.0)
next (3.13.0-alpha.0)
prerelease (1.3.0-alpha.0)
3.13.0-alpha.0
3.12.0
3.3.0
3.0.1
3.0.0
3.0.0-alpha.0
2.17.0
2.17.0-alpha.0
2.10.0
2.10.0-alpha.0
2.6.0
2.5.0
2.1.2
2.1.0
2.0.1-alpha.0
1.18.1
1.15.0
1.7.4
1.7.0
1.6.1
1.3.0
1.3.0-alpha.0
1.2.0
1.0.0
0.0.200-alpha.0
visx drag
github.com/airbnb/visx
airbnb/visx
@visx/drag
/
esm
/
util
/
clampNumber.js
4 lines
•
178 B
JavaScript
View Raw
1
2
3
4
/** Clamps number within the inclusive lower and upper bounds. */
export
default
function
clampNumber
(
number
, lower, upper
) {
return
Math
.
min
(
Math
.
max
(
number
, lower), upper); }