Skip to content

MegaFileIndexer

reference
1 min readUpdated

Kind: Class

Source: atloria-monorepo/packages/doc-automation/src/v2/stages/stage-01-parse/mega-file-indexer.ts

Mega File Indexer - Handles extremely large files with phased extraction

Methods

MethodSignatureReturns
detectMegaFiledetectMegaFile(filePath: string)Promise<MegaFileDetectionResult>
createIndexcreateIndex(filePath: string)Promise<MegaFileIndex>
extractAllPhasesextractAllPhases(filePath: string)Promise<MegaFilePhaseExtractionResult>
loadSectionloadSection(filePath: string, startLine: number, endLine: number)Promise<string>
loadEntityloadEntity(index: MegaFileIndex, entityName: string)`Promise<string

Where it refuses work

  • MegaFileIndexer stops the work with an early return when seen.has(key).
  • MegaFileIndexer stops the work with an early return when callPattern.test(content).
  • MegaFileIndexer stops the work with an early return when extendsPattern.test(content).
  • MegaFileIndexer stops the work with an early return when !entity.

When something fails

  • MegaFileIndexer handles failure in 2 places: it logs it and continues in 1, and turns it into a return value in 1.

Was this page helpful?

Download as PDF