forked from sheetjs/sheetjs
Fixing accidental detection of require.js as common js
I changed to code to check for common js by looking for exports and module instead. Also, would it be possible to require fs inside the function where it's used?
This commit is contained in:
parent
f1aa13dfaf
commit
cd2cd0ba0d
8
xlsx.js
8
xlsx.js
@ -360,9 +360,11 @@ function parseZip(zip) {
|
||||
|
||||
var fs, jszip;
|
||||
if(typeof JSZip !== "undefined") jszip = JSZip;
|
||||
if(typeof require !== "undefined") {
|
||||
if(typeof jszip === 'undefined') jszip = require('./jszip').JSZip;
|
||||
fs = require('fs');
|
||||
if (typeof exports !== 'undefined') {
|
||||
if (typeof module !== 'undefined' && module.exports) {
|
||||
if(typeof jszip === 'undefined') jszip = require('./jszip').JSZip;
|
||||
fs = require('fs');
|
||||
}
|
||||
}
|
||||
|
||||
function readSync(data, options) {
|
||||
|
Loading…
Reference in New Issue
Block a user