mirror of
https://github.com/simple-icons/simple-icons.git
synced 2024-11-16 00:59:07 +02:00
ddc3fe09d4
As discussed in https://github.com/simple-icons/simple-icons/pull/1555
22 lines
521 B
JavaScript
22 lines
521 B
JavaScript
var icons = {%s};
|
|
|
|
Object.defineProperty(icons, "get", {
|
|
enumerable: false,
|
|
value: function(targetName) {
|
|
if (icons[targetName]) {
|
|
return icons[targetName];
|
|
} else {
|
|
var normalizedName = targetName.toLowerCase();
|
|
for (var iconName in icons) {
|
|
var icon = icons[iconName];
|
|
if ((icon.title && icon.title.toLowerCase() === normalizedName)
|
|
|| (icon.slug && icon.slug === normalizedName)) {
|
|
return icon;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
module.exports = icons;
|