(node: SafeXmlNode)
| 21 | * Parse all attributes of a node into a local-name keyed map. |
| 22 | */ |
| 23 | export function parseAllAttributes(node: SafeXmlNode): Map<string, string> { |
| 24 | const result = new Map<string, string>() |
| 25 | const el = node.element |
| 26 | if (!el) return result |
| 27 | const attrs = el.attributes |
| 28 | for (let i = 0; i < attrs.length; i++) { |
| 29 | const attr = attrs[i] |
| 30 | result.set(attr.localName, attr.value) |
| 31 | } |
| 32 | return result |
| 33 | } |
no test coverage detected