You've already forked simple-icons
mirror of
https://github.com/simple-icons/simple-icons.git
synced 2025-10-30 23:07:47 +02:00
Remove get-by-title from NPM package API (#4920)
This commit is contained in:
@@ -34,12 +34,7 @@ function escape(value) {
|
||||
return value.replace(/(?<!\\)'/g, "\\'");
|
||||
}
|
||||
function iconToKeyValue(icon) {
|
||||
let iconName = escape(icon.title);
|
||||
if (icon.slug !== titleToSlug(icon.title)) {
|
||||
iconName = icon.slug;
|
||||
}
|
||||
|
||||
return `'${iconName}':${iconToObject(icon)}`;
|
||||
return `'${icon.slug}':${iconToObject(icon)}`;
|
||||
}
|
||||
function licenseToObject(license) {
|
||||
if (license === undefined) {
|
||||
|
||||
@@ -3,22 +3,7 @@ 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.slug === normalizedName) {
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
for (var iconName in icons) {
|
||||
var icon = icons[iconName];
|
||||
if (icon.title.toLowerCase() === normalizedName) {
|
||||
return icon;
|
||||
}
|
||||
}
|
||||
return icons[targetName];
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user