Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/wrappers/wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ export default class Wrapper implements BaseWrapper {
* Returns an Object containing all the attribute/value pairs on the element.
*/
attributes (): { [name: string]: string } {
const attributes = [...this.element.attributes] // NameNodeMap is not iterable
const attributes = this.element.attributes
const attributeMap = {}
attributes.forEach((att) => {
for (let i = 0; i < attributes.length; i++) {
const att = attributes.item(i)
attributeMap[att.localName] = att.value
})
}
return attributeMap
}

Expand Down