export function randomIntInRange()

in src/common/utils.ts [8:18]


export function randomIntInRange(min, max) {
    if (min > max) {
        throw new Error(`min (${min}) can"t be bigger than max (${max})`);
    }
    if (min === max) {
        return min;
    }
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min; // The maximum is exclusive and the minimum is inclusive
}