Skip to content

Commit

Permalink
office parser fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonamy committed May 9, 2024
1 parent 7f6ed2e commit f5a1f10
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/text.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

import { app } from 'electron'
import PDFParser from 'pdf2json'
import officeParser from 'officeparser'

Expand All @@ -16,7 +17,9 @@ function getPDFRawTextContent(contents: string): Promise<string> {
}

function getOfficeRawTextContent(contents: string): Promise<string> {
return officeParser.parseOfficeAsync(Buffer.from(contents, 'base64'))
return officeParser.parseOfficeAsync(Buffer.from(contents, 'base64'), {
tempFilesLocation: app.getPath('temp'),

Check failure on line 21 in src/main/text.ts

View workflow job for this annotation

GitHub Actions / build

tests/unit/text.test.ts > Word

TypeError: Cannot read properties of undefined (reading 'getPath') ❯ getOfficeRawTextContent src/main/text.ts:21:28 ❯ Module.getTextContent src/main/text.ts:34:14 ❯ tests/unit/text.test.ts:20:22

Check failure on line 21 in src/main/text.ts

View workflow job for this annotation

GitHub Actions / build

tests/unit/text.test.ts > PowerPoint

TypeError: Cannot read properties of undefined (reading 'getPath') ❯ getOfficeRawTextContent src/main/text.ts:21:28 ❯ Module.getTextContent src/main/text.ts:34:14 ❯ tests/unit/text.test.ts:26:22

Check failure on line 21 in src/main/text.ts

View workflow job for this annotation

GitHub Actions / build

tests/unit/text.test.ts > Excel

TypeError: Cannot read properties of undefined (reading 'getPath') ❯ getOfficeRawTextContent src/main/text.ts:21:28 ❯ Module.getTextContent src/main/text.ts:34:14 ❯ tests/unit/text.test.ts:32:22
})
}

export function getTextContent(contents: string, format: string): Promise<string> {
Expand Down

0 comments on commit f5a1f10

Please sign in to comment.