@i-xi-dev/base64
Version:
A JavaScript Base64 encoder and decoder, implements Forgiving base64 defined in WHATWG Infra Standard.
35 lines (34 loc) • 1.04 kB
JavaScript
import * as _Utils from "./_utils.js";
export var BigIntRange;
(function (BigIntRange) {
function resolve(range) {
let min = BigInt(Number.MIN_SAFE_INTEGER);
let max = BigInt(Number.MAX_SAFE_INTEGER);
if (Array.isArray(range)) {
if (range.length > 0) {
if (_Utils._isBigInt(range[0])) {
min = range[0];
}
else {
throw new TypeError("range[0]");
}
if (range.length > 1) {
if (_Utils._isBigInt(range[1])) {
max = range[1];
}
else {
throw new TypeError("range[1]");
}
}
else {
max = min;
}
}
}
return [
_Utils._min(min, max),
_Utils._max(min, max),
];
}
BigIntRange.resolve = resolve;
})(BigIntRange || (BigIntRange = {}));