UNPKG

@studiometa/js-toolkit

Version:

A set of useful little bits of JavaScript to boost your project! 🚀

8 lines (7 loc) • 257 B
function damp(targetValue, currentValue, factor = 0.5, precision = 0.01) { return Math.abs(targetValue - currentValue) < precision ? targetValue : currentValue + (targetValue - currentValue) * factor; } export { damp }; //# sourceMappingURL=damp.js.map