Skip to content

TypeORMParser

reference
1 min readUpdated

Kind: Class

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

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 arrowMatch.
  • TypeORMParser stops the work with an early return when /^\w+$/.test(text).

When something fails

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

Was this page helpful?

Download as PDF