MCPcopy Create free account
hub / github.com/Snapchat/Valdi / findMethod

Function findMethod

npm_modules/cli/src/core/analyze/parser.ts:134–149  ·  view source on GitHub ↗
(sourceFile: ts.SourceFile, methodName: string)

Source from the content-addressed store, hash-verified

132}
133
134function findMethod(sourceFile: ts.SourceFile, methodName: string): ts.Node | undefined {
135 for (const statement of sourceFile.statements) {
136 if (!ts.isClassDeclaration(statement)) continue;
137 for (const member of statement.members) {
138 if (
139 ts.isMethodDeclaration(member) &&
140 member.name &&
141 ts.isIdentifier(member.name) &&
142 member.name.text === methodName
143 ) {
144 return member.body;
145 }
146 }
147 }
148 return undefined;
149}
150
151function detectFlags(sourceFile: ts.SourceFile, content: string, imports: string[]): FingerprintFlags {
152 const hasLoadingKeywords =

Callers 1

extractRenderElementsFunction · 0.85

Calls 1

isIdentifierMethod · 0.80

Tested by

no test coverage detected