Skip to content

MdxParser

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/apps/config-docs-parser/src/parsers/mdx.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
nameany
versionany
supportedPatternsany

Where it refuses work

  • MdxParser stops the work with Error when !content — “Content is required for parsing”.
  • MdxParser stops the work with an early return when trimmed && !trimmed.startsWith('#') && !trimmed.startsWith('```') && !trimmed.startsWith(….

When something fails

  • MdxParser handles failure in 1 place: it turns it into a return value in all 1.

Was this page helpful?

Download as PDF