(function() {
/**
* @enum {Help4.control.ICONS}
*/
Help4.control2.ICONS = Help4.control.ICONS;
/**
* resolves an icon id towards the ICONS collection
* @memberof Help4.control2
* @param {string} iconId
* @returns {string}
*/
Help4.control2.correctIcon = iconId => {
const icons = Help4.control2.ICONS;
// id exists in icons, e.g. "close"
if (icons[iconId]) return iconId;
for (const [key, value] of Object.entries(icons)) {
// id exists as value of a key, use the key instead
if (value === iconId) return key;
}
// wrong icon id
return 'bug';
}
})();