simple-icons/scripts/templates/index.js
Eric Cornelissen a4ca74602f
Minor improvements (#4708)
* Remove .travis.yml reference from .gitattributes

* Minor refactoring of .svglintrc.js

- Remove unused variables
- Fix missing semi-colons
- Remove unneeded indentation

* Prevent error in clean command due to missing files

* Fix indentations

* Further improvements to Editorconfig and indentation

* Format YAML files

- Update indentation for array notation
- Normalize use of newlines
2021-01-15 21:47:00 +01:00

20 lines
453 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;