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

Function getImportStringLiteralsFromSourceFile

compiler/companion/src/AST.ts:498–509  ·  view source on GitHub ↗
(sourceFile: ts.SourceFile)

Source from the content-addressed store, hash-verified

496 return false;
497 } else if (nodeComments.match(/@Component/)) {
498 return !!(getNodeComments(memberNode)?.text ?? '').match(/@Action|@ConstructorOmitted/g);
499 } else if (hasGenerateOrExportAnnotation(nodeComments)) {
500 return true;
501 } else {
502 return false;
503 }
504}
505
506export function getImportStringLiteralsFromSourceFile(sourceFile: ts.SourceFile): ts.StringLiteral[] {
507 const output: ts.StringLiteral[] = [];
508 for (const statement of sourceFile.statements) {
509 if (ts.isImportDeclaration(statement)) {
510 const importDeclaration: ts.ImportDeclaration = statement;
511 if (ts.isStringLiteral(importDeclaration.moduleSpecifier)) {
512 output.push(importDeclaration.moduleSpecifier);

Callers 3

AST.spec.tsFile · 0.90
doOpenFileMethod · 0.90
validateImportsMethod · 0.90

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected