From 050ccbef5d768a232b9dd08eeb5000f8340b3cd9 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Mon, 10 Jan 2022 23:51:41 +0100 Subject: MathUtils: Fix eslint issues and add missing jsdoc comment --- res/qml/Mixxx/MathUtils.mjs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/res/qml/Mixxx/MathUtils.mjs b/res/qml/Mixxx/MathUtils.mjs index e399e23b87..e7b500b7b4 100644 --- a/res/qml/Mixxx/MathUtils.mjs +++ b/res/qml/Mixxx/MathUtils.mjs @@ -1,3 +1,9 @@ -export function clamp(value, min, max) { +/** + * @param {number} value Value + * @param {number} min Lower bound + * @param {number} max Upper bound + * @returns {number} Value clamped between min and max + */ +export const clamp = function(value, min, max) { return Math.max(Math.min(value, max), min); }; -- cgit v1.2.3