simple-icons/scripts/templates/index.js

26 lines
566 B
JavaScript
Raw Normal View History

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];
2021-02-19 16:06:43 +03:00
if (icon.slug === normalizedName) {
return icon;
}
}
for (var iconName in icons) {
var icon = icons[iconName];
if (icon.title.toLowerCase() === normalizedName) {
return icon;
}
}
}
});
module.exports = icons;