Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
(value: number) => {
let nextValue = value;
if (keepWithinRange) {
nextValue = constrainValue(nextValue, min, max);
}
return roundToPrecision(nextValue, precision);
},
[precision, keepWithinRange, max, min],