Kind: Class
Source: atloria-monorepo/libs/parser-core/src/parsers/database/migration.parser.ts
Migration Parser implementation
Implements: IParser
Methods
| Method | Signature | Returns |
|---|---|---|
initialize | initialize(_config: ParserConfig) | Promise<void> |
canParse | canParse(filePath: string) | boolean |
parseFile | parseFile(filePath: string, content: string) | Promise<ParseResult> |
parseFiles | parseFiles(files: ParseFileInput[]) | Promise<ParseResult[]> |
destroy | destroy() | Promise<void> |
Properties
| Property | Type |
|---|---|
name | any |
version | any |
supportedPatterns | any |
Where it refuses work
MigrationParserstops the work with an early return when!this.canParse(filePath).MigrationParserstops the work with an early return when!fileContent.trim().MigrationParserstops the work with an early return whenfilePath.includes('/prisma/migrations/').MigrationParserstops the work with an early return whenfilePath.includes('/typeorm/migrations/') || /\d{13}-\w+\.ts$/.test(filePath).MigrationParserstops the work with an early return when/^V\d+__/.test(filePath.split('/').pop() || '').MigrationParserstops the work with an early return whenfilePath.includes('changelog').
When something fails
MigrationParserhandles failure in 4 places: it turns it into a return value in 3, and logs it and continues in 1.
Was this page helpful?