MCPcopy Create free account
hub / github.com/cometchat/cometchat-uikit-angular / extractOutputs

Function extractOutputs

scripts/docs-audit.ts:192–207  ·  view source on GitHub ↗

* Extracts @Output() property names from a component .ts file using regex. * * Handles patterns: * - @Output() eventName = new EventEmitter (); * - @Output() eventName = new EventEmitter();

(componentFilePath: string)

Source from the content-addressed store, hash-verified

190 * - @Output() eventName = new EventEmitter();
191 */
192function extractOutputs(componentFilePath: string): string[] {
193 const content = fs.readFileSync(componentFilePath, 'utf-8');
194 const outputs: string[] = [];
195
196 const outputRegex = /@Output\(\)\s+(\w+)\s*=\s*new\s+EventEmitter/g;
197 let match: RegExpExecArray | null;
198
199 while ((match = outputRegex.exec(content)) !== null) {
200 const eventName = match[1];
201 if (eventName && !outputs.includes(eventName)) {
202 outputs.push(eventName);
203 }
204 }
205
206 return outputs.sort();
207}
208
209// ============================================
210// Task 1.3: MDX Properties/Events Table Parsing

Callers 1

auditComponentFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected