function getIndexes(rangeStr) {
    /**
     * Example ranges:
     * "15"
     * "1,2,3"
     * "2-3"
     * "2-3,5,8-11"
     */

    if (!rangeStr)
        return {};

    /**
     * @type {string[]}
     */
    const split = rangeStr
        ?.trim()
        .replaceAll(' ', '')
        .split(',') || [];

    const ranges = {};

    for (const indexGroup of split) {
        const indexes = indexGroup.split('-') || [];

        if (indexes.length === 1) {
            ranges[indexes] = true;
        } else {
            const start = parseInt(indexes[0]);
            const end = parseInt(indexes[1]);

            for (let index=start; index<=end; index++) {
                ranges[index] = true;
            }
        }
    }

    return ranges;
}
@param {string} rangeStr
@returns {Object.<number, boolean>}