Skip to content

VueParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/frontend-parser/src/parsers/vue.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
namestring
versionstring
supportedPatternsstring[]

Where it refuses work

  • VueParser stops the work with an early return when !this.canParse(filePath).
  • VueParser stops the work with an early return when !fileContent.trim().
  • VueParser stops the work with an early return when !scriptContent && !hasTemplate.
  • VueParser stops the work with an early return when !scriptContent.trim().

When something fails

  • VueParser handles failure in 4 places: it turns it into a return value in 2, logs it and continues in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.

Was this page helpful?

Download as PDF