We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f2c7e97 commit 60d048aCopy full SHA for 60d048a
src/dom-wrapper.ts
@@ -23,11 +23,10 @@ export class DOMWrapper<ElementType extends Element> {
23
attributes(): { [key: string]: string }
24
attributes(key: string): string
25
attributes(key?: string): { [key: string]: string } | string {
26
- const attributes = this.element.attributes
+ const attributes = Array.from(this.element.attributes)
27
const attributeMap: Record<string, string> = {}
28
- for (let i = 0; i < attributes.length; i++) {
29
- const att = attributes.item(i)!
30
- attributeMap[att.localName] = att.value
+ for (const attribute of attributes) {
+ attributeMap[attribute.localName] = attribute.value
31
}
32
33
return key ? attributeMap[key] : attributeMap
0 commit comments