Kind: Class
Source: atloria-monorepo/libs/parser-core/src/parsers/frontend/vue.parser.ts
Vue Parser
Pure TypeScript class that parses Vue Single File Components. 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
VueParserstops the work with an early return when!this.canParse(filePath).VueParserstops the work with an early return when!fileContent.trim().VueParserstops the work with an early return when!parseVue.VueParserstops the work with an early return when!scriptContent && !hasTemplate.VueParserstops the work with an early return when!scriptContent.trim().VueParserstops the work with an early return when!hasVueRouter.
When something fails
VueParserhandles failure in 7 places: it logs it and continues in 4, turns it into a return value in 2, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.
Was this page helpful?