-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7384141
commit e0d0226
Showing
14 changed files
with
106 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import xml from '../xml/xml' | ||
|
||
import unpackXlsxFile from './unpackXlsxFileBrowser' | ||
import readXlsxFileContents from './readXlsxFileContents' | ||
|
||
/** | ||
* Reads XLSX file into a 2D array of cells in a web worker. | ||
* @param {file} file - The file. | ||
* @param {object?} options | ||
* @param {(number|string)?} options.sheet - Excel document sheet to read. Defaults to `1`. Will only read this sheet and skip others. | ||
* @return {Promise} Resolves to a 2D array of cells: an array of rows, each row being an array of cells. | ||
*/ | ||
export default function readXlsxFile(file, options = {}) { | ||
return unpackXlsxFile(file) | ||
.then((entries) => readXlsxFileContents(entries, xml, options)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import XMLDOM from '@xmldom/xmldom' | ||
|
||
export default { | ||
createDocument(content) { | ||
return new XMLDOM.DOMParser().parseFromString(content) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
exports = module.exports = require('../commonjs/read/readXlsxFileWebWorker').default | ||
exports['default'] = require('../commonjs/read/readXlsxFileWebWorker').default | ||
exports.parseExcelDate = require('../commonjs/read/parseDate').default | ||
exports.Integer = require('../commonjs/types/Integer').default | ||
exports.Email = require('../commonjs/types/Email').default | ||
exports.URL = require('../commonjs/types/URL').default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from '../index.d'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export { default as default } from '../modules/read/readXlsxFileNode' | ||
export { default as parseExcelDate } from '../modules/read/parseDate' | ||
export { default as Integer } from '../modules/types/Integer' | ||
export { default as Email } from '../modules/types/Email' | ||
export { default as URL } from '../modules/types/URL' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"private": true, | ||
"name": "read-excel-file/web-worker", | ||
"version": "1.0.0", | ||
"main": "index.commonjs.js", | ||
"module": "index.js", | ||
"types": "./index.d.ts", | ||
"sideEffects": false | ||
} |