function generateIconOptions()

in electron-installer/rpm.js [49:78]


function generateIconOptions(icons) {
    /** @type {Array.<string>} */
    const iconFiles = glob.sync(globUtils.toGlobs(icons, "png"), { dot: true });

    if (!iconFiles || iconFiles.length <= 0) {
        return undefined;
    }

    /** @type {IDictionary.<string>} */
    const iconObj = {};

    for (const iconFileName of iconFiles) {
        if (path.basename(iconFileName) === "scalable.svg") {
            iconObj["scalable"] = iconFileName;

        } else if (path.extname(iconFileName) === ".png") {
            const match = iconFileName.match(/(\d+)/g);

            if (match) {
                const size = match[0];

                if (size) {
                    iconObj[`${size}x${size}`] = iconFileName;
                }
            }
        }
    }

    return iconObj;
}