add tag.getByname()

This commit is contained in:
evilchili committed 2026-10-17 18:09:19 -07:00
1 parent 241f67fb4d
commit 77b68bf272
3 files changed
+12

No files matched your search

+1
View File
@@ -32,6 +32,7 @@ export declare class TagCollection implements TagCollectionType {
tags: TagType[];
map: Map<string, TagType[]>;
constructor(tags: TagType[]);
getByName(name: string): TagType;
getByElementName(element: string): TagType | undefined;
}
export {};
+5
View File
@@ -143,6 +143,11 @@ class TagCollection {
}
}
}
getByName(name) {
return this.tags.filter(t => {
t.constructor.name == name;
})[0] || undefined;
}
getByElementName(element) {
const el = element.toUpperCase();
return this.tags.filter(t => {