Skip to content

Commit

Permalink
Fix #1013: set XLSX lib manually
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiasrw committed Aug 6, 2018
1 parent c1ca94c commit a899ba7
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 23 deletions.
4 changes: 2 additions & 2 deletions dist/alasql-worker.js
@@ -1,7 +1,7 @@
//! AlaSQL v0.4.9 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
//! AlaSQL v0.4.9-develop-c1ca94ccundefined | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
/*
@module alasql
@version 0.4.9
@version 0.4.9-develop-c1ca94ccundefined
AlaSQL - JavaScript SQL database
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
Expand Down
2 changes: 1 addition & 1 deletion dist/alasql-worker.min.js

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

22 changes: 17 additions & 5 deletions dist/alasql.fs.js
@@ -1,7 +1,7 @@
//! AlaSQL v0.4.9 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
//! AlaSQL v0.4.9-develop-c1ca94ccundefined | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
/*
@module alasql
@version 0.4.9
@version 0.4.9-develop-c1ca94ccundefined

AlaSQL - JavaScript SQL database
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
Expand Down Expand Up @@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
Current version of alasql
@constant {string}
*/
alasql.version = '0.4.9';
alasql.version = '0.4.9-develop-c1ca94ccundefined';

/**
Debug flag
Expand Down Expand Up @@ -4288,8 +4288,12 @@ utils.findAlaSQLPath = function() {
};

var getXLSX = function() {
var XLSX = null;
/* If require() shuold be supported else take from global scope */
var XLSX = alasql.private.externalXlsxLib;

if (XLSX) {
return XLSX;
}

if (utils.isNode || utils.isBrowserify || utils.isMeteorServer) {
//*not-for-browser/*
XLSX = require('xlsx') || null;
Expand Down Expand Up @@ -4527,6 +4531,14 @@ alasql.lastid = 0;

alasql.buffer = {};

alasql.private = {
externalXlsxLib: null,
};

alasql.setXLSX = function(XLSX) {
alasql.private.externalXlsxLib = XLSX;
};

/**
Select current database
@param {string} databaseid Selected database identificator
Expand Down
22 changes: 17 additions & 5 deletions dist/alasql.js
@@ -1,7 +1,7 @@
//! AlaSQL v0.4.9 | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
//! AlaSQL v0.4.9-develop-c1ca94ccundefined | © 2014-2016 Andrey Gershun & Mathias Rangel Wulff | License: MIT
/*
@module alasql
@version 0.4.9
@version 0.4.9-develop-c1ca94ccundefined

AlaSQL - JavaScript SQL database
© 2014-2016 Andrey Gershun & Mathias Rangel Wulff
Expand Down Expand Up @@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
Current version of alasql
@constant {string}
*/
alasql.version = '0.4.9';
alasql.version = '0.4.9-develop-c1ca94ccundefined';

/**
Debug flag
Expand Down Expand Up @@ -4283,8 +4283,12 @@ utils.findAlaSQLPath = function() {
};

var getXLSX = function() {
var XLSX = null;
/* If require() shuold be supported else take from global scope */
var XLSX = alasql["private"].externalXlsxLib;

if (XLSX) {
return XLSX;
}

if (utils.isNode || utils.isBrowserify || utils.isMeteorServer) {
/*not-for-browser/*
XLSX = require('xlsx') || null;
Expand Down Expand Up @@ -4522,6 +4526,14 @@ alasql.lastid = 0;

alasql.buffer = {};

alasql["private"] = {
externalXlsxLib: null,
};

alasql.setXLSX = function(XLSX) {
alasql["private"].externalXlsxLib = XLSX;
};

/**
Select current database
@param {string} databaseid Selected database identificator
Expand Down
16 changes: 8 additions & 8 deletions dist/alasql.min.js

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions src/15utility.js
Expand Up @@ -1272,8 +1272,12 @@ utils.findAlaSQLPath = function() {
};

var getXLSX = function() {
var XLSX = null;
/* If require() shuold be supported else take from global scope */
var XLSX = alasql.private.externalXlsxLib;

if (XLSX) {
return XLSX;
}

if (utils.isNode || utils.isBrowserify || utils.isMeteorServer) {
//*not-for-browser/*
XLSX = require('xlsx') || null;
Expand Down
8 changes: 8 additions & 0 deletions src/17alasql.js
Expand Up @@ -133,6 +133,14 @@ alasql.lastid = 0;

alasql.buffer = {};

alasql.private = {
externalXlsxLib: null,
};

alasql.setXLSX = function(XLSX) {
alasql.private.externalXlsxLib = XLSX;
};

/**
Select current database
@param {string} databaseid Selected database identificator
Expand Down

0 comments on commit a899ba7

Please sign in to comment.