Kind: Class
Source: atloria-monorepo/apps/config-docs-parser/src/parsers/yaml.parser.ts
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
YamlParserstops the work withErrorwhen!content— “Content is required for parsing”.YamlParserstops the work with an early return whenfileName.includes('docker-compose') || fileName.includes('compose.y').YamlParserstops the work with an early return whenfirstDoc.services || firstDoc.version.YamlParserstops the work with an early return whenfileName.includes('.github/workflows/') || fileName.includes('/.github/workflows/').YamlParserstops the work with an early return whenfirstDoc.on && firstDoc.jobs.YamlParserstops the work with an early return whenfileName.includes('.gitlab-ci').
When something fails
YamlParserhandles failure in 1 place: it turns it into a return value in all 1.
Was this page helpful?