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

Method parseFile

apps/sim/lib/file-parsers/xlsx-parser.ts:25–43  ·  view source on GitHub ↗

* Read the file into a buffer and delegate to parseBuffer so the * decompression-bomb guard runs before SheetJS inflates the workbook.

(filePath: string)

Source from the content-addressed store, hash-verified

23 * decompression-bomb guard runs before SheetJS inflates the workbook.
24 */
25 async parseFile(filePath: string): Promise<FileParseResult> {
26 try {
27 if (!filePath) {
28 throw new Error('No file path provided')
29 }
30
31 if (!existsSync(filePath)) {
32 throw new Error(`File not found: ${filePath}`)
33 }
34
35 logger.info(`Parsing XLSX file: ${filePath}`)
36
37 const buffer = await readFile(filePath)
38 return this.parseBuffer(buffer)
39 } catch (error) {
40 logger.error('XLSX file parsing error:', error)
41 throw new Error(`Failed to parse XLSX file: ${(error as Error).message}`)
42 }
43 }
44
45 async parseBuffer(buffer: Buffer): Promise<FileParseResult> {
46 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