MCPcopy Index your code
hub / github.com/angular/angular / insertCorruptedTextNodeMarkers

Function insertCorruptedTextNodeMarkers

packages/core/src/hydration/annotate.ts:865–872  ·  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

863 * @param doc The document
864 */
865function insertCorruptedTextNodeMarkers(
866 corruptedTextNodes: Map<HTMLElement, string>,
867 doc: Document,
868) {
869 for (const [textNode, marker] of corruptedTextNodes) {
870 textNode.after(doc.createComment(marker));
871 }
872}
873
874/**
875 * 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…