MCPcopy Index your code
hub / github.com/simstudioai/sim / parseFile

Method parseFile

apps/sim/lib/file-parsers/pdf-parser.ts:8–25  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

6
7export class PdfParser implements FileParser {
8 async parseFile(filePath: string): Promise<FileParseResult> {
9 try {
10 logger.info('Starting to parse file:', filePath)
11
12 if (!filePath) {
13 throw new Error('No file path provided')
14 }
15
16 logger.info('Reading file...')
17 const dataBuffer = await readFile(filePath)
18 logger.info('File read successfully, size:', dataBuffer.length)
19
20 return this.parseBuffer(dataBuffer)
21 } catch (error) {
22 logger.error('Error reading file:', error)
23 throw error
24 }
25 }
26
27 async parseBuffer(dataBuffer: Buffer): Promise<FileParseResult> {
28 try {

Callers

nothing calls this directly

Calls 4

parseBufferMethod · 0.95
readFileFunction · 0.85
infoMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected