@ozen-ui/icons
Version:
A collection of icons
28 lines (27 loc) • 904 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Icons = void 0;
var Icons = /** @class */ (function () {
function Icons(icons) {
this.icons = icons;
this.byGroup = this.getByGroup();
}
Icons.prototype.getByComponentName = function (componentName) {
return this.icons.find(function (meta) { return meta.componentName === componentName; });
};
Icons.prototype.getByName = function (name) {
return this.icons.find(function (meta) { return meta.name === name; });
};
Icons.prototype.getByGroup = function () {
var byGroup = {};
this.icons.forEach(function (icon) {
if (!byGroup[icon.group]) {
byGroup[icon.group] = [];
}
byGroup[icon.group].push(icon);
});
return byGroup;
};
return Icons;
}());
exports.Icons = Icons;