Kind: Class
Source: atloria-monorepo/apps/config-docs-parser/src/parsers/env.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
EnvParserstops the work withErrorwhen!content— “Content is required for parsing”.EnvParserstops the work with an early return whenisExample && this.isPlaceholderValue(envVar.value).EnvParserstops the work with an early return when!envVar.value || envVar.value.trim() === ''.EnvParserstops the work with an early return when!value || value.trim() === ''.EnvParserstops the work with an early return whentrimmed === 'true' || trimmed === 'false'.EnvParserstops the work with an early return whentrimmed === '1' || trimmed === '0'.
When something fails
EnvParserhandles failure in 1 place: it turns it into a return value in all 1.
Was this page helpful?