Skip to content

LargeFileIndexer

reference
1 min readUpdated

Kind: Class

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

Large File Indexer - Creates indexes for files >500KB

Methods

MethodSignatureReturns
isLargeFileisLargeFile(filePath: string)Promise<boolean>
createIndexcreateIndex(filePath: string)Promise<LargeFileIndex>

Where it refuses work

  • LargeFileIndexer stops the work with an early return when firstLines.includes(marker).
  • LargeFileIndexer stops the work with an early return when pattern.test(fileName).
  • LargeFileIndexer stops the work with an early return when filePath.includes(dirPattern).
  • LargeFileIndexer stops the work with an early return when pattern.test(code).
  • LargeFileIndexer stops the work with an early return when foundOpen && braceCount === 0.
  • LargeFileIndexer stops the work with an early return when match.

When something fails

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

Was this page helpful?

Download as PDF