MCPcopy Create free account
hub / github.com/angular/angular / insertCorruptedTextNodeMarkers

Function insertCorruptedTextNodeMarkers

packages/core/src/hydration/annotate.ts:864–871  ·  view source on GitHub ↗

* Physically inserts the comment nodes to ensure empty text nodes and adjacent * text node separators are preserved after server serialization of the DOM. * These get swapped back for empty text nodes or separators once hydration happens * on the client. * * @param corruptedTextNodes The Map of

(
  corruptedTextNodes: Map<HTMLElement, string>,
  doc: Document,
)

Source from the content-addressed store, hash-verified

862 * @param doc The document
863 */
864function insertCorruptedTextNodeMarkers(
865 corruptedTextNodes: Map<HTMLElement, string>,
866 doc: Document,
867) {
868 for (const [textNode, marker] of corruptedTextNodes) {
869 textNode.after(doc.createComment(marker));
870 }
871}
872
873/**
874 * Detects whether a given TNode represents a node that

Callers 1

annotateForHydrationFunction · 0.85

Calls 1

createCommentMethod · 0.65

Tested by

no test coverage detected