frontend/.pnpm-store/v3/files/c6/b2bb671c0cb54ceb7ce6ea92a0c56553a4ea17a468260e03cd2a9047e0616e62e93649e13e7d8a7babe941c36a61f71020d071cc4b649efa3b7b4e3933d825-exec

11 lines
353 B
Plaintext
Executable File

export function DefaultNumberOption(val, min, max, fallback) {
if (val !== undefined) {
val = Number(val);
if (isNaN(val) || val < min || val > max) {
throw new RangeError("".concat(val, " is outside of range [").concat(min, ", ").concat(max, "]"));
}
return Math.floor(val);
}
return fallback;
}