This commit is contained in:
nik
2025-10-03 22:27:28 +03:00
parent 829fad0e17
commit 871cf7e792
16520 changed files with 2967597 additions and 3 deletions

30
node_modules/radash/dist/esm/number.mjs generated vendored Normal file
View File

@@ -0,0 +1,30 @@
function inRange(number, start, end) {
const isTypeSafe = typeof number === "number" && typeof start === "number" && (typeof end === "undefined" || typeof end === "number");
if (!isTypeSafe) {
return false;
}
if (typeof end === "undefined") {
end = start;
start = 0;
}
return number >= Math.min(start, end) && number < Math.max(start, end);
}
const toFloat = (value, defaultValue) => {
const def = defaultValue === void 0 ? 0 : defaultValue;
if (value === null || value === void 0) {
return def;
}
const result = parseFloat(value);
return isNaN(result) ? def : result;
};
const toInt = (value, defaultValue) => {
const def = defaultValue === void 0 ? 0 : defaultValue;
if (value === null || value === void 0) {
return def;
}
const result = parseInt(value);
return isNaN(result) ? def : result;
};
export { inRange, toFloat, toInt };
//# sourceMappingURL=number.mjs.map