Files
cannaiq/frontend/node_modules/es-toolkit/dist/math/clamp.mjs
2025-11-28 19:45:44 -07:00

9 lines
187 B
JavaScript

function clamp(value, bound1, bound2) {
if (bound2 == null) {
return Math.min(value, bound1);
}
return Math.min(Math.max(value, bound1), bound2);
}
export { clamp };