mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-18 03:14:11 +03:00
f6bd00315a
Remove redundant truthy check for properties of icons in index.js We test if all icon scan be retrieved anyway, if any icon is missing these properties we would find out during testing.
20 lines
454 B
JavaScript
20 lines
454 B
JavaScript
var icons = {%s};
|
|
|
|
Object.defineProperty(icons, "get", {
|
|
enumerable: false,
|
|
value: function(targetName) {
|
|
if (icons[targetName]) {
|
|
return icons[targetName];
|
|
}
|
|
var normalizedName = targetName.toLowerCase();
|
|
for (var iconName in icons) {
|
|
var icon = icons[iconName];
|
|
if (icon.title.toLowerCase() === normalizedName || icon.slug === normalizedName) {
|
|
return icon;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
module.exports = icons;
|