alasql 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- //! AlaSQL v2.0.0-develop-e1af3440undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v2.0.1-develop-04b99c42undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 2.0.0-develop-e1af3440undefined
4
+ @version 2.0.1-develop-04b99c42undefined
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2016 Andrey Gershun & Mathias Rangel Wulff
@@ -1,2 +1,2 @@
1
- //! AlaSQL v2.0.0-develop-e1af3440undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v2.0.1-develop-04b99c42undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  !function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.alasql=e()}(this,function(){function i(r,e,o){"function"==typeof(e=e||[])&&(scope=o,o=e,e=[]),"object"!=typeof e&&(e=[e]);var t=i.lastid++;i.buffer[t]=o,i.webworker.postMessage({id:t,sql:r,params:e})}var a;if(i.options={},i.options.progress=function(){},isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)},i.promise=function(){throw new Error("Please include a Promise/A+ library")},"undefined"!=typeof Promise&&(a=function(r,e,n,s){return new Promise(function(o,t){i(r,e,function(r,e){e?t(e):(n&&s&&!1!==i.options.progress&&i.options.progress(n,s),o(r))})})},i.promise=function(r,e){if("undefined"==typeof Promise)throw new Error("Please include a Promise/A+ library");if("string"==typeof r)return a(r,e);if(!isArray(r)||r.length<1||void 0!==e)throw new Error("Error in .promise parameters");var o=r;if(!(o.length<1)){for(var t,n,s=[],i=0;i<o.length;i++){if("string"==typeof(n=o[i])&&(n=[n]),!isArray(n)||n.length<1||2<n.length)throw new Error("Error in .promise parameter");t=n[0],n=n[1]||void 0,s.push(a(t,n,i,o.length))}return Promise.all(s)}}),i=i||!1)return i.worker=function(){throw new Error("Can find webworker in this enviroment")},"undefined"!=typeof Worker&&(i.worker=function(r,e,o){if(void 0===(r=!0===r?void 0:r))for(var t=document.getElementsByTagName("script"),n=0;n<t.length;n++){if("alasql-worker.js"===t[n].src.substr(-16).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-16)+"alasql.js";break}if("alasql-worker.min.js"===t[n].src.substr(-20).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-20)+"alasql.min.js";break}if("alasql.js"===t[n].src.substr(-9).toLowerCase()){r=t[n].src;break}if("alasql.min.js"===t[n].src.substr(-13).toLowerCase()){r=t[n].src.substr(0,t[n].src.length-13)+"alasql.min.js";break}}if(void 0===r)throw new Error("Path to alasql.js is not specified");var s;!1!==r?(s=(s="importScripts('")+r+"');self.onmessage = function(event) {alasql(event.data.sql,event.data.params, function(data){postMessage({id:event.data.id, data:data});});}",s=new Blob([s],{type:"text/plain"}),i.webworker=new Worker(URL.createObjectURL(s)),i.webworker.onmessage=function(r){var e=r.data.id;i.buffer[e](r.data.data),delete i.buffer[e]},i.webworker.onerror=function(r){throw r},1<arguments.length&&i("REQUIRE "+e.map(function(r){return'"'+r+'"'}).join(","),[],o)):!1===r&&delete i.webworker}),i.lastid=0,i.buffer={},i.worker(),i;throw new Error("alasql was not found")});
package/dist/alasql.fs.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v2.0.0-develop-e1af3440undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v2.0.1-develop-04b99c42undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 2.0.0-develop-e1af3440undefined
4
+ @version 2.0.1-develop-04b99c42undefined
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2016 Andrey Gershun & Mathias Rangel Wulff
@@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
142
142
  Current version of alasql
143
143
  @constant {string}
144
144
  */
145
- alasql.version = '2.0.0-develop-e1af3440undefined';
145
+ alasql.version = '2.0.1-develop-04b99c42undefined';
146
146
 
147
147
  /**
148
148
  Debug flag
@@ -4523,6 +4523,8 @@ alasql.options.nocount = false;
4523
4523
  // Check for NaN and convert it to undefined
4524
4524
  alasql.options.nan = false;
4525
4525
 
4526
+ alasql.options.excel = {cellDates: true};
4527
+
4526
4528
  alasql.options.joinstar = 'overwrite'; // Option for SELECT * FROM a,b
4527
4529
 
4528
4530
  //alasql.options.worker = false;
@@ -17098,7 +17100,7 @@ alasql.into.XLSX = function (filename, opts, data, columns, cb) {
17098
17100
  // ToDo: check if cb must be treated differently here
17099
17101
  if (opts.sourcefilename) {
17100
17102
  alasql.utils.loadBinaryFile(opts.sourcefilename, !!cb, function (data) {
17101
- wb = XLSX.read(data, {type: 'binary', ...opts.XLSXopts});
17103
+ wb = XLSX.read(data, {type: 'binary', ...alasql.options.excel, ...opts});
17102
17104
  doExport();
17103
17105
  });
17104
17106
  } else {
@@ -17607,9 +17609,9 @@ function XLSXLSX(X, filename, opts, cb, idx, query) {
17607
17609
  // function processData(data) {
17608
17610
  if (data instanceof ArrayBuffer) {
17609
17611
  var arr = fixdata(data);
17610
- var workbook = X.read(btoa(arr), {type: 'base64', ...opts.XLSXopts});
17612
+ var workbook = X.read(btoa(arr), {type: 'base64', ...alasql.options.excel, ...opts});
17611
17613
  } else {
17612
- var workbook = X.read(data, {type: 'binary', ...opts.XLSXopts});
17614
+ var workbook = X.read(data, {type: 'binary', ...alasql.options.excel, ...opts});
17613
17615
  }
17614
17616
 
17615
17617
  var sheetid;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v2.0.0-develop-e1af3440undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v2.0.1-develop-04b99c42undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 2.0.0-develop-e1af3440undefined
4
+ @version 2.0.1-develop-04b99c42undefined
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2016 Andrey Gershun & Mathias Rangel Wulff
@@ -142,7 +142,7 @@ var alasql = function(sql, params, cb, scope) {
142
142
  Current version of alasql
143
143
  @constant {string}
144
144
  */
145
- alasql.version = '2.0.0-develop-e1af3440undefined';
145
+ alasql.version = '2.0.1-develop-04b99c42undefined';
146
146
 
147
147
  /**
148
148
  Debug flag
@@ -4518,6 +4518,8 @@ alasql.options.nocount = false;
4518
4518
  // Check for NaN and convert it to undefined
4519
4519
  alasql.options.nan = false;
4520
4520
 
4521
+ alasql.options.excel = {cellDates: true};
4522
+
4521
4523
  alasql.options.joinstar = 'overwrite'; // Option for SELECT * FROM a,b
4522
4524
 
4523
4525
  //alasql.options.worker = false;
@@ -17093,7 +17095,7 @@ alasql.into.XLSX = function (filename, opts, data, columns, cb) {
17093
17095
  // ToDo: check if cb must be treated differently here
17094
17096
  if (opts.sourcefilename) {
17095
17097
  alasql.utils.loadBinaryFile(opts.sourcefilename, !!cb, function (data) {
17096
- wb = XLSX.read(data, {type: 'binary', ...opts.XLSXopts});
17098
+ wb = XLSX.read(data, {type: 'binary', ...alasql.options.excel, ...opts});
17097
17099
  doExport();
17098
17100
  });
17099
17101
  } else {
@@ -17602,9 +17604,9 @@ function XLSXLSX(X, filename, opts, cb, idx, query) {
17602
17604
  // function processData(data) {
17603
17605
  if (data instanceof ArrayBuffer) {
17604
17606
  var arr = fixdata(data);
17605
- var workbook = X.read(btoa(arr), {type: 'base64', ...opts.XLSXopts});
17607
+ var workbook = X.read(btoa(arr), {type: 'base64', ...alasql.options.excel, ...opts});
17606
17608
  } else {
17607
- var workbook = X.read(data, {type: 'binary', ...opts.XLSXopts});
17609
+ var workbook = X.read(data, {type: 'binary', ...alasql.options.excel, ...opts});
17608
17610
  }
17609
17611
 
17610
17612
  var sheetid;