(node: TextNode, text: string)
| 423 | } |
| 424 | |
| 425 | export const setTextNodeValue = (node: TextNode, text: string): void => { |
| 426 | if (typeof text !== 'string') { |
| 427 | text = String(text) |
| 428 | } |
| 429 | |
| 430 | // Skip if unchanged |
| 431 | if (node.nodeValue === text) { |
| 432 | return |
| 433 | } |
| 434 | |
| 435 | node.nodeValue = text |
| 436 | markDirty(node) |
| 437 | } |
| 438 | |
| 439 | function isDOMElement(node: DOMElement | TextNode): node is DOMElement { |
| 440 | return node.nodeName !== '#text' |
no test coverage detected