MCPcopy
hub / github.com/webpack/webpack / walk

Function walk

test/buildHtmlAst.unittest.js:56–63  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

54 let found;
55 /** @param {import("../lib/html/syntax").HtmlNode} node node to search */
56 const walk = (node) => {
57 if (found || node.type !== NodeType.Element) return;
58 if (node.tagName === tagName) {
59 found = node;
60 return;
61 }
62 for (const c of node.children) walk(c);
63 };
64 for (const c of buildHtmlAst(src).children) walk(c);
65 return /** @type {import("../lib/html/syntax").HtmlElement} */ (found);
66};

Callers 1

findFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected