LendAndRegret/node_modules/es-toolkit/dist/math/clamp.js
2026-05-02 17:27:43 +08:00

13 lines
281 B
JavaScript

'use strict';
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
function clamp(value, bound1, bound2) {
if (bound2 == null) {
return Math.min(value, bound1);
}
return Math.min(Math.max(value, bound1), bound2);
}
exports.clamp = clamp;