* Stringifies a given TNode's attributes * * @param tNode a provided TNode * @returns string
(tNode: TNode)
| 242 | * @returns string |
| 243 | */ |
| 244 | function stringifyTNodeAttrs(tNode: TNode): string { |
| 245 | const results = []; |
| 246 | if (tNode.attrs) { |
| 247 | for (let i = 0; i < tNode.attrs.length; ) { |
| 248 | const attrName = tNode.attrs[i++]; |
| 249 | // Once we reach the first flag, we know that the list of |
| 250 | // attributes is over. |
| 251 | if (typeof attrName == 'number') { |
| 252 | break; |
| 253 | } |
| 254 | const attrValue = tNode.attrs[i++]; |
| 255 | results.push(`${attrName}="${shorten(attrValue as string)}"`); |
| 256 | } |
| 257 | } |
| 258 | return results.join(' '); |
| 259 | } |
| 260 | |
| 261 | /** |
| 262 | * The list of internal attributes that should be filtered out while |
no test coverage detected
searching dependent graphs…