Function
serializeAttributes
(attrs?: Record<string, string>)
Source from the content-addressed store, hash-verified
| 217 | } |
| 218 | |
| 219 | function serializeAttributes(attrs?: Record<string, string>): string { |
| 220 | if (!attrs) return '' |
| 221 | let out = '' |
| 222 | for (const [k, v] of Object.entries(attrs)) { |
| 223 | if (v === undefined || v === null) continue |
| 224 | out += ` ${k}="${escapeXml(String(v))}"` |
| 225 | } |
| 226 | return out |
| 227 | } |
| 228 | |
| 229 | /** |
| 230 | * Marshals a JS value into XML under the `wd:` namespace. |
Tested by
no test coverage detected