This repository has been archived on 2026-03-06. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
openclaw-extensions/wecom/node_modules/linkedom/esm/interface/named-node-map.js
T

43 lines
847 B
JavaScript

/**
* @implements globalThis.NamedNodeMap
*/
export class NamedNodeMap extends Array {
constructor(ownerElement) {
super();
this.ownerElement = ownerElement;
}
getNamedItem(name) {
return this.ownerElement.getAttributeNode(name);
}
setNamedItem(attr) {
this.ownerElement.setAttributeNode(attr);
this.unshift(attr);
}
removeNamedItem(name) {
const item = this.getNamedItem(name);
this.ownerElement.removeAttribute(name);
this.splice(this.indexOf(item), 1);
}
item(index) {
return index < this.length ? this[index] : null;
}
/* c8 ignore start */
getNamedItemNS(_, name) {
return this.getNamedItem(name);
}
setNamedItemNS(_, attr) {
return this.setNamedItem(attr);
}
removeNamedItemNS(_, name) {
return this.removeNamedItem(name);
}
/* c8 ignore stop */
}