Files
NapCatQQ/.pnpm-store/v3/files/2a/aace7bce69b20d15b884c3100ce1d50439ccbd70ac711503b77480eba4154a14e8d84410a8721e901d2e7d313dd6e9b75d4e98b4d8932fcb48ce44629530fe
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

22 lines
626 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DefaultNumberOption = DefaultNumberOption;
/**
* https://tc39.es/ecma402/#sec-defaultnumberoption
* @param val
* @param min
* @param max
* @param fallback
*/
function DefaultNumberOption(inputVal, min, max, fallback) {
if (inputVal === undefined) {
// @ts-expect-error
return fallback;
}
var val = Number(inputVal);
if (isNaN(val) || val < min || val > max) {
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
}
return Math.floor(val);
}