diff --git a/src/util/clip.js b/src/util/clip.js index 844a18038..fae9caa85 100644 --- a/src/util/clip.js +++ b/src/util/clip.js @@ -8,7 +8,7 @@ * @param {number} high The upper bound. * @returns {number} The clipped value. */ -export default function clip(val, low, high) { +export function clip(val, low, high) { return Math.min(Math.max(low, val), high); } @@ -26,3 +26,5 @@ export function clipToBox(point, box) { point.x = clip(point.x, 0, box.width); point.y = clip(point.y, 0, box.height); } + +export default clip;