MCPcopy Create free account
hub / github.com/anus-dev/ANUS / walkTokens

Function walkTokens

packages/core/src/utils/memoryImportProcessor.test.ts:48–58  ·  view source on GitHub ↗
(tokenList: unknown[])

Source from the content-addressed store, hash-verified

46 const comments: string[] = [];
47
48 function walkTokens(tokenList: unknown[]) {
49 for (const token of tokenList) {
50 const t = token as { type: string; raw: string; tokens?: unknown[] };
51 if (t.type === 'html' && t.raw.includes('<!--')) {
52 comments.push(t.raw.trim());
53 }
54 if (t.tokens) {
55 walkTokens(t.tokens);
56 }
57 }
58 }
59
60 walkTokens(tokens);
61 return comments;

Callers 3

findMarkdownCommentsFunction · 0.85
findCodeBlocksFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected