MCPcopy Index your code
hub / github.com/Linen-dev/linen.dev / findByType

Function findByType

packages/ast/find/index.js:11–20  ·  view source on GitHub ↗
(tree, selector)

Source from the content-addressed store, hash-verified

9}
10
11function findByType(tree, selector) {
12 const nodes = [];
13
14 walk(tree, (node) => {
15 if (compare(node.type, selector)) {
16 nodes.push(node);
17 }
18 });
19 return nodes;
20}
21
22function findUserIds(tree) {
23 return unique(findMentions(tree).map((node) => node.id));

Callers 2

findMentionsFunction · 0.85
findUrlsFunction · 0.85

Calls 2

walkFunction · 0.85
compareFunction · 0.85

Tested by

no test coverage detected