Kind: Class
Source: atloria-monorepo/libs/parser-core/src/parsers/frontend/angular.parser.ts
Angular Parser
Pure TypeScript class that parses Angular TypeScript files. No NestJS dependencies required.
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 | string |
version | string |
supportedPatterns | string[] |
Where it refuses work
AngularParserstops the work with an early return when!name, in 4 places.AngularParserstops the work with an early return whenfilePath.endsWith('.component.ts') || filePath.endsWith('.directive.ts') || filePath.ends….AngularParserstops the work with an early return whenfilePath.endsWith('.service.ts') || filePath.endsWith('.module.ts') || filePath.endsWith(….AngularParserstops the work with an early return when!this.canParse(filePath).AngularParserstops the work with an early return when!fileContent.trim().AngularParserstops the work with an early return whenjsDocs.length > 0.
When something fails
AngularParserhandles failure in 2 places: it logs it and continues in 1, and turns it into a return value in 1.
Was this page helpful?