(
/** @type {HtmlElement | HtmlDocument | HtmlDocumentFragment} */ parent,
/** @type {HtmlNode} */ node
)
| 4703 | : parent.children; |
| 4704 | |
| 4705 | const appendTo = ( |
| 4706 | /** @type {HtmlElement | HtmlDocument | HtmlDocumentFragment} */ parent, |
| 4707 | /** @type {HtmlNode} */ node |
| 4708 | ) => { |
| 4709 | const arr = childrenOf(parent); |
| 4710 | const last = arr[arr.length - 1]; |
| 4711 | if (node.type === NodeType.Text && last && last.type === NodeType.Text) { |
| 4712 | last.data += node.data; |
| 4713 | if (node.end !== undefined) last.end = node.end; |
| 4714 | return; |
| 4715 | } |
| 4716 | arr.push(node); |
| 4717 | }; |
| 4718 | |
| 4719 | // Reused result of `appropriatePlace` — consumed synchronously by |
| 4720 | // `insertAtPlace` and never retained, so one shared object avoids an |
no test coverage detected