Skip to content

Commit

Permalink
use string for parsing file instead of buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
tuvia-ru committed Sep 4, 2022
1 parent 0582402 commit 3d90c4a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/package.json
Expand Up @@ -10,7 +10,7 @@
"author": "",
"license": "ISC",
"dependencies": {
"xlsx-file-parser-light": "0.0.7"
"xlsx-file-parser-light": "file:../xlsx-file-parser-light-0.0.7.tgz"
},
"devDependencies": {
"html-loader": "^4.1.0",
Expand Down
6 changes: 3 additions & 3 deletions src/parser/parser.ts
Expand Up @@ -10,7 +10,7 @@ const NA = {

export interface ParsedFile {
name: string;
contents: Buffer;
contents: string;
}

export class XLSXParser {
Expand All @@ -37,7 +37,7 @@ export class XLSXParser {
this.filesParsed = await Promise.all(
files.map(async (file) => ({
name: file.path,
contents: await file.file.async('nodebuffer'),
contents: await file.file.async('string'),
}))
);

Expand Down Expand Up @@ -116,7 +116,7 @@ export class XLSXParser {

const sharedStringsXml =
new XMLDOM.DOMParser().parseFromString(
sharedStrings?.contents.toString()
sharedStrings?.contents
);
const sharedValues = select(
"//a:si",
Expand Down

0 comments on commit 3d90c4a

Please sign in to comment.