Skip to content

ExpressParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/backend-parser/src/parsers/express.parser.ts

Express Parser implementation

Implements: IParser

Methods

MethodSignatureReturns
initializeinitialize(config: ParserConfig)Promise<void>
canParsecanParse(filePath: string)boolean
parseFileparseFile(filePath: string, content: string)Promise<ParseResult>
parseFilesparseFiles(files: ParseFileInput[])Promise<ParseResult[]>
destroydestroy()Promise<void>

Properties

PropertyType
nameany
versionany
supportedPatternsany

Where it refuses work

  • ExpressParser stops the work with an early return when args.length === 0, in 2 places.
  • ExpressParser stops the work with an early return when !fileContent.trim().
  • ExpressParser stops the work with an early return when !t.isIdentifier(node.id).

When something fails

  • ExpressParser handles failure in 1 place: it turns it into a return value in all 1.

Was this page helpful?

Download as PDF