Skip to content

SequelizeParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/database-parser/src/parsers/sequelize.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

  • SequelizeParser stops the work with an early return when args.length === 0, in 5 places.
  • SequelizeParser stops the work with an early return when !this.canParse(filePath).
  • SequelizeParser stops the work with an early return when tableNameMatch.
  • SequelizeParser stops the work with an early return when !allowNullDecorator.
  • SequelizeParser stops the work with an early return when !defaultDecorator.
  • SequelizeParser stops the work with an early return when text.startsWith('"') || text.startsWith("'").

When something fails

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

Was this page helpful?

Download as PDF