MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / extractBrightScriptGlobalFields

Function extractBrightScriptGlobalFields

src/ast/extract-brightscript.ts:240–252  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

238 * Used by middleware + config detectors as app-wide declared state.
239 */
240export function extractBrightScriptGlobalFields(content: string): GlobalFieldRegistration[] {
241 const out: GlobalFieldRegistration[] = [];
242 const lines = content.split("\n");
243 const pattern = /\bm\.global\.(?:AddField|addField)\s*\(\s*["']([^"']+)["']\s*,\s*["']([^"']+)["']/gi;
244 for (let i = 0; i < lines.length; i++) {
245 let m: RegExpExecArray | null;
246 pattern.lastIndex = 0;
247 while ((m = pattern.exec(lines[i])) !== null) {
248 out.push({ name: m[1], type: m[2], line: i + 1 });
249 }
250 }
251 return out;
252}
253
254/**
255 * Heuristic: RudderstackTask event name payloads.

Callers 1

detectMiddlewareFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected