MCPcopy Create free account
hub / github.com/CoderLine/alphaTab / walk

Function walk

packages/tooling/src/vite.plugin.transform.ts:111–126  ·  view source on GitHub ↗
(node: unknown, visit: (n: { type: string }) => void)

Source from the content-addressed store, hash-verified

109}
110
111function walk(node: unknown, visit: (n: { type: string }) => void): void {
112 if (!node || typeof node !== 'object') { return; }
113 const typed = node as { type?: string };
114 if (typeof typed.type === 'string') {
115 visit(typed as { type: string });
116 }
117 for (const key of Object.keys(node)) {
118 if (key === 'parent') { continue; }
119 const value = (node as Record<string, unknown>)[key];
120 if (Array.isArray(value)) {
121 for (const v of value) { walk(v, visit); }
122 } else if (value && typeof value === 'object' && typeof (value as { type?: string }).type === 'string') {
123 walk(value, visit);
124 }
125 }
126}

Callers 1

handlerFunction · 0.85

Calls 3

visitFunction · 0.85
isArrayMethod · 0.80
keysMethod · 0.45

Tested by

no test coverage detected