Archived
Template
1
Fork 0
This repository has been archived on 2024-09-04. You can view files and clone it, but cannot push or open issues or pull requests.
Contour/public/@shoelace-style/shoelace/cdn/chunks/chunk.HF7GESMZ.js

16 lines
285 B
JavaScript
Raw Normal View History

2024-01-30 10:59:28 -05:00
// src/internal/math.ts
function clamp(value, min, max) {
const noNegativeZero = (n) => Object.is(n, -0) ? 0 : n;
if (value < min) {
return noNegativeZero(min);
}
if (value > max) {
return noNegativeZero(max);
}
return noNegativeZero(value);
}
export {
clamp
};