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

Function describeDomFromNode

packages/core/src/hydration/error_handling.ts:375–391  ·  view source on GitHub ↗

* Builds the string containing the DOM present around a given RNode for a * readable error message * * @param node the RNode * @returns string

(node: RNode)

Source from the content-addressed store, hash-verified

373 * @returns string
374 */
375function describeDomFromNode(node: RNode): string {
376 const spacer = ' ';
377 let content = '';
378 const currentNode = node as HTMLElement;
379 if (currentNode.previousSibling) {
380 content += spacer + '…\n';
381 content += spacer + describeRNode(currentNode.previousSibling) + '\n';
382 }
383 content += spacer + describeRNode(currentNode) + ` ${AT_THIS_LOCATION}\n`;
384 if (node.nextSibling) {
385 content += spacer + '…\n';
386 }
387 if (node.parentNode) {
388 content = describeRNode(currentNode.parentNode as Node, '\n' + content);
389 }
390 return content;
391}
392
393/**
394 * Shortens the description of a given RNode by its type for readability

Callers 4

validateMatchingNodeFunction · 0.85
invalidSkipHydrationHostFunction · 0.85

Calls 1

describeRNodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…