mirror of
https://github.com/Mibew/simple-icons.git
synced 2024-11-17 19:04:13 +03:00
18 lines
443 B
JavaScript
18 lines
443 B
JavaScript
|
var icons = {%s};
|
||
|
|
||
|
module.exports = icons;
|
||
|
module.exports.get = 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;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|