Skip to content

TypeORMParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/libs/parser-core/src/parsers/database/typeorm.parser.ts

TypeORM 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

  • TypeORMParser stops the work with an early return when args.length === 0, in 4 places.
  • TypeORMParser stops the work with an early return when text.startsWith('"') || text.startsWith("'"), in 2 places.
  • TypeORMParser stops the work with an early return when nameMatch, in 2 places.
  • TypeORMParser stops the work with an early return when !this.canParse(filePath).
  • TypeORMParser stops the work with an early return when !fileContent.trim().
  • TypeORMParser stops the work with an early return when arrowMatch.

When something fails

  • TypeORMParser handles failure in 2 places: it turns it into a return value in all 2.

Was this page helpful?

Download as PDF