alasql 1.7.2 → 1.7.4

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.
@@ -13,7 +13,7 @@ jobs:
13
13
 
14
14
  strategy:
15
15
  matrix:
16
- node-version: [12.x, 14.x, 15.x]
16
+ node-version: [12.x, 14.x, 16.x, 17.x]
17
17
 
18
18
  steps:
19
19
  - uses: actions/checkout@v2
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npm test
package/README.md CHANGED
@@ -1,7 +1,3 @@
1
- <h2>
2
- Please use version 1.x as prior versions has a security flaw if you use user generated data to concat your SQL strings instead of providing them as a parameters to AlaSQL.
3
- </h2>
4
-
5
1
  _AlaSQL is an open source project used on more than two million page views per month - and we appreciate any and all contributions we can get. [Please help out](https://github.com/agershun/alasql/labels/Please%20help%20out%21)._
6
2
 
7
3
  _Have a question? Ask on [Stack Overflow](http://stackoverflow.com/questions/ask?tags=AlaSQL) using the "alasql" tag._
@@ -475,7 +471,7 @@ var b = browserify("./main.js").bundle();
475
471
 
476
472
  #### Vue
477
473
 
478
- For some frameworks (lige Vue) alasql cant access XLSX by it self. We recommend handeling it by including AlaSQL the following way:
474
+ For some frameworks (lige Vue) alasql cant access XLSX by it self. We recommend handling it by including AlaSQL the following way:
479
475
 
480
476
  ```import alasql from 'alasql';
481
477
  import XLSX from 'xlsx';
@@ -605,9 +601,15 @@ The testruns can be found in the [testlog](TESTLOG.md).
605
601
 
606
602
 
607
603
 
608
- ## Bleeding Edge
604
+ ## Contributing
605
+
606
+ See [Contributing](CONTRIBUTING.md) for details.
607
+
608
+ Thanks to all the people who already contributed!
609
609
 
610
- If you want to try the most recent development version of the library please download [this file](https://rawgit.com/agershun/alasql/develop/dist/alasql.fs.js) or visit the [testbench](https://rawgit.com/agershun/alasql/develop/utils/testbench.html) to play around in the browser console.
610
+ <a href="https://github.com/agershun/alasql/graphs/contributors">
611
+ <img src="https://contributors-img.web.app/image?repo=agershun/alasql" />
612
+ </a>
611
613
 
612
614
 
613
615
  ## License
@@ -1,7 +1,7 @@
1
- //! AlaSQL v1.7.2 | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v1.7.4-develop-89075a50undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 1.7.2
4
+ @version 1.7.4-develop-89075a50undefined
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2016 Andrey Gershun & Mathias Rangel Wulff
@@ -1,2 +1,2 @@
1
- //! AlaSQL v1.7.2 | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
- !function(r,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():r.alasql=e()}(this,function(){function a(r,e,t){"function"==typeof(e=e||[])&&(scope=t,t=e,e=[]),"object"!=typeof e&&(e=[e]);var o=a.lastid++;a.buffer[o]=t,a.webworker.postMessage({id:o,sql:r,params:e})}if(a.options={},a.options.progress=function(){},isArray=function(r){return"[object Array]"===Object.prototype.toString.call(r)},a.promise=function(){throw new Error("Please include a Promise/A+ library")},"undefined"!=typeof Promise){function i(r,e,n,s){return new Promise(function(t,o){a(r,e,function(r,e){e?o(e):(n&&s&&!1!==a.options.progress&&a.options.progress(n,s),t(r))})})}a.promise=function(r,e){if("undefined"==typeof Promise)throw new Error("Please include a Promise/A+ library");if("string"==typeof r)return i(r,e);if(!isArray(r)||r.length<1||void 0!==e)throw new Error("Error in .promise parameters");return function(r){if(!(r.length<1)){for(var e,t,o,n=[],s=0;s<r.length;s++){if("string"==typeof(e=r[s])&&(e=[e]),!isArray(e)||e.length<1||2<e.length)throw new Error("Error in .promise parameter");t=e[0],o=e[1]||void 0,n.push(i(t,o,s,r.length))}return Promise.all(n)}}(r)}}if(!(a=a||!1))throw new Error("alasql was not found");return a.worker=function(){throw new Error("Can find webworker in this enviroment")},"undefined"!=typeof Worker&&(a.worker=function(r,e,t){if(!0===r&&(r=void 0),void 0===r)for(var o=document.getElementsByTagName("script"),n=0;n<o.length;n++){if("alasql-worker.js"===o[n].src.substr(-16).toLowerCase()){r=o[n].src.substr(0,o[n].src.length-16)+"alasql.js";break}if("alasql-worker.min.js"===o[n].src.substr(-20).toLowerCase()){r=o[n].src.substr(0,o[n].src.length-20)+"alasql.min.js";break}if("alasql.js"===o[n].src.substr(-9).toLowerCase()){r=o[n].src;break}if("alasql.min.js"===o[n].src.substr(-13).toLowerCase()){r=o[n].src.substr(0,o[n].src.length-13)+"alasql.min.js";break}}if(void 0===r)throw new Error("Path to alasql.js is not specified");if(!1!==r){var s="importScripts('";s+=r,s+="');self.onmessage = function(event) {alasql(event.data.sql,event.data.params, function(data){postMessage({id:event.data.id, data:data});});}";var i=new Blob([s],{type:"text/plain"});if(a.webworker=new Worker(URL.createObjectURL(i)),a.webworker.onmessage=function(r){var e=r.data.id;a.buffer[e](r.data.data),delete a.buffer[e]},a.webworker.onerror=function(r){throw r},1<arguments.length)a("REQUIRE "+e.map(function(r){return'"'+r+'"'}).join(","),[],t)}else if(!1===r)return void delete a.webworker}),a.lastid=0,a.buffer={},a.worker(),a});
1
+ //! AlaSQL v1.7.4-develop-89075a50undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
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 v1.7.2 | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v1.7.4-develop-89075a50undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 1.7.2
4
+ @version 1.7.4-develop-89075a50undefined
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 = '1.7.2';
145
+ alasql.version = '1.7.4-develop-89075a50undefined';
146
146
 
147
147
  /**
148
148
  Debug flag
@@ -7963,7 +7963,7 @@ yy.Select.prototype.compile = function (databaseid, params) {
7963
7963
  // If this is INTO() function, then call it
7964
7964
  // with one or two parameters
7965
7965
  //
7966
- var qs = "return alasql.into[" + JSON.stringify(this.into.funcid.toUpperCase()) + "](";
7966
+ var qs = 'return alasql.into[' + JSON.stringify(this.into.funcid.toUpperCase()) + '](';
7967
7967
  if (this.into.args && this.into.args.length > 0) {
7968
7968
  qs += this.into.args[0].toJS() + ',';
7969
7969
  if (this.into.args.length > 1) {
@@ -8409,7 +8409,7 @@ yy.Select.prototype.compileFrom = function (query) {
8409
8409
  ps += ');if(cb)res=cb(res,idx,query);return res';
8410
8410
  source.datafn = new Function('query,params,cb,idx,alasql', ps);
8411
8411
  } else if (tq instanceof yy.FuncValue) {
8412
- ps = "var res=alasql.from[" + JSON.stringify(tq.funcid.toUpperCase()) + "](";
8412
+ ps = 'var res=alasql.from[' + JSON.stringify(tq.funcid.toUpperCase()) + '](';
8413
8413
 
8414
8414
  if (tq.args && tq.args.length > 0) {
8415
8415
  if (tq.args[0]) {
@@ -8672,7 +8672,7 @@ yy.Select.prototype.compileJoins = function (query) {
8672
8672
  };
8673
8673
  // source.data = ;
8674
8674
 
8675
- var s = "var res=alasql.from[" + JSON.stringify(jn.func.funcid.toUpperCase()) + "](";
8675
+ var s = 'var res=alasql.from[' + JSON.stringify(jn.func.funcid.toUpperCase()) + '](';
8676
8676
 
8677
8677
  var args = jn.func.args;
8678
8678
  if (args && args.length > 0) {
@@ -10846,7 +10846,7 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
10846
10846
  if (!(!this.right.args || 0 === this.right.args.length)) {
10847
10847
  var ss = this.right.args.map(ref);
10848
10848
  }
10849
- s = '' + ljs + "[" + JSON.stringify(this.right.funcid) + "](" + ss.join(',') + ')';
10849
+ s = '' + ljs + '[' + JSON.stringify(this.right.funcid) + '](' + ss.join(',') + ')';
10850
10850
  } else {
10851
10851
  s = '' + ljs + '[' + rightJS() + ']';
10852
10852
  }
@@ -11821,10 +11821,13 @@ stdlib.MIN = stdlib.LEAST = function () {
11821
11821
  );
11822
11822
  };
11823
11823
 
11824
- stdlib.SUBSTRING = stdlib.SUBSTR = stdlib.MID = function (a, b, c) {
11825
- if (arguments.length == 2) return und(a, 'y.substr(' + b + '-1)');
11826
- else if (arguments.length == 3) return und(a, 'y.substr(' + b + '-1,' + c + ')');
11827
- };
11824
+ stdlib.SUBSTRING =
11825
+ stdlib.SUBSTR =
11826
+ stdlib.MID =
11827
+ function (a, b, c) {
11828
+ if (arguments.length == 2) return und(a, 'y.substr(' + b + '-1)');
11829
+ else if (arguments.length == 3) return und(a, 'y.substr(' + b + '-1,' + c + ')');
11830
+ };
11828
11831
 
11829
11832
  stdfn.REGEXP_LIKE = function (a, b, c) {
11830
11833
 
@@ -12048,13 +12051,16 @@ alasql.aggr.VARP = function (v, s, stage) {
12048
12051
  }
12049
12052
  };
12050
12053
 
12051
- alasql.aggr.STD = alasql.aggr.STDDEV = alasql.aggr.STDEVP = function (v, s, stage) {
12052
- if (stage == 1 || stage == 2) {
12053
- return alasql.aggr.VARP(v, s, stage);
12054
- } else {
12055
- return Math.sqrt(alasql.aggr.VARP(v, s, stage));
12056
- }
12057
- };
12054
+ alasql.aggr.STD =
12055
+ alasql.aggr.STDDEV =
12056
+ alasql.aggr.STDEVP =
12057
+ function (v, s, stage) {
12058
+ if (stage == 1 || stage == 2) {
12059
+ return alasql.aggr.VARP(v, s, stage);
12060
+ } else {
12061
+ return Math.sqrt(alasql.aggr.VARP(v, s, stage));
12062
+ }
12063
+ };
12058
12064
 
12059
12065
  alasql._aggrOriginal = alasql.aggr;
12060
12066
  alasql.aggr = {};
@@ -12076,34 +12082,37 @@ for (var i = 0; i < 256; i++) {
12076
12082
  lut[i] = (i < 16 ? '0' : '') + i.toString(16);
12077
12083
  }
12078
12084
 
12079
- stdfn.NEWID = stdfn.UUID = stdfn.GEN_RANDOM_UUID = function () {
12080
- var d0 = (Math.random() * 0xffffffff) | 0;
12081
- var d1 = (Math.random() * 0xffffffff) | 0;
12082
- var d2 = (Math.random() * 0xffffffff) | 0;
12083
- var d3 = (Math.random() * 0xffffffff) | 0;
12084
- return (
12085
- lut[d0 & 0xff] +
12086
- lut[(d0 >> 8) & 0xff] +
12087
- lut[(d0 >> 16) & 0xff] +
12088
- lut[(d0 >> 24) & 0xff] +
12089
- '-' +
12090
- lut[d1 & 0xff] +
12091
- lut[(d1 >> 8) & 0xff] +
12092
- '-' +
12093
- lut[((d1 >> 16) & 0x0f) | 0x40] +
12094
- lut[(d1 >> 24) & 0xff] +
12095
- '-' +
12096
- lut[(d2 & 0x3f) | 0x80] +
12097
- lut[(d2 >> 8) & 0xff] +
12098
- '-' +
12099
- lut[(d2 >> 16) & 0xff] +
12100
- lut[(d2 >> 24) & 0xff] +
12101
- lut[d3 & 0xff] +
12102
- lut[(d3 >> 8) & 0xff] +
12103
- lut[(d3 >> 16) & 0xff] +
12104
- lut[(d3 >> 24) & 0xff]
12105
- );
12106
- };
12085
+ stdfn.NEWID =
12086
+ stdfn.UUID =
12087
+ stdfn.GEN_RANDOM_UUID =
12088
+ function () {
12089
+ var d0 = (Math.random() * 0xffffffff) | 0;
12090
+ var d1 = (Math.random() * 0xffffffff) | 0;
12091
+ var d2 = (Math.random() * 0xffffffff) | 0;
12092
+ var d3 = (Math.random() * 0xffffffff) | 0;
12093
+ return (
12094
+ lut[d0 & 0xff] +
12095
+ lut[(d0 >> 8) & 0xff] +
12096
+ lut[(d0 >> 16) & 0xff] +
12097
+ lut[(d0 >> 24) & 0xff] +
12098
+ '-' +
12099
+ lut[d1 & 0xff] +
12100
+ lut[(d1 >> 8) & 0xff] +
12101
+ '-' +
12102
+ lut[((d1 >> 16) & 0x0f) | 0x40] +
12103
+ lut[(d1 >> 24) & 0xff] +
12104
+ '-' +
12105
+ lut[(d2 & 0x3f) | 0x80] +
12106
+ lut[(d2 >> 8) & 0xff] +
12107
+ '-' +
12108
+ lut[(d2 >> 16) & 0xff] +
12109
+ lut[(d2 >> 24) & 0xff] +
12110
+ lut[d3 & 0xff] +
12111
+ lut[(d3 >> 8) & 0xff] +
12112
+ lut[(d3 >> 16) & 0xff] +
12113
+ lut[(d3 >> 24) & 0xff]
12114
+ );
12115
+ };
12107
12116
 
12108
12117
  /*
12109
12118
  //
@@ -17166,7 +17175,8 @@ alasql.into.XLSX = function (filename, opts, data, columns, cb) {
17166
17175
  var colm = 1,
17167
17176
  rowm = 1;
17168
17177
  }
17169
- var colmax = Math.max(col0 + columns.length, colm);
17178
+ var zeroColumnFix = columns.length ? 0 : 1;
17179
+ var colmax = Math.max(col0 + columns.length - 1 + zeroColumnFix, colm);
17170
17180
  var rowmax = Math.max(row0 + dataLength + 2, rowm);
17171
17181
 
17172
17182
  var i = row0 + 1;
@@ -19657,7 +19667,14 @@ var saveAs =
19657
19667
  FS_proto.WRITING = 1;
19658
19668
  FS_proto.DONE = 2;
19659
19669
 
19660
- FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null;
19670
+ FS_proto.error =
19671
+ FS_proto.onwritestart =
19672
+ FS_proto.onprogress =
19673
+ FS_proto.onwrite =
19674
+ FS_proto.onabort =
19675
+ FS_proto.onerror =
19676
+ FS_proto.onwriteend =
19677
+ null;
19661
19678
 
19662
19679
  return saveAs;
19663
19680
  })(
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v1.7.2 | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
1
+ //! AlaSQL v1.7.4-develop-89075a50undefined | © 2014-2018 Andrey Gershun & Mathias Rangel Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 1.7.2
4
+ @version 1.7.4-develop-89075a50undefined
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 = '1.7.2';
145
+ alasql.version = '1.7.4-develop-89075a50undefined';
146
146
 
147
147
  /**
148
148
  Debug flag
@@ -7958,7 +7958,7 @@ yy.Select.prototype.compile = function (databaseid, params) {
7958
7958
  // If this is INTO() function, then call it
7959
7959
  // with one or two parameters
7960
7960
  //
7961
- var qs = "return alasql.into[" + JSON.stringify(this.into.funcid.toUpperCase()) + "](";
7961
+ var qs = 'return alasql.into[' + JSON.stringify(this.into.funcid.toUpperCase()) + '](';
7962
7962
  if (this.into.args && this.into.args.length > 0) {
7963
7963
  qs += this.into.args[0].toJS() + ',';
7964
7964
  if (this.into.args.length > 1) {
@@ -8404,7 +8404,7 @@ yy.Select.prototype.compileFrom = function (query) {
8404
8404
  ps += ');if(cb)res=cb(res,idx,query);return res';
8405
8405
  source.datafn = new Function('query,params,cb,idx,alasql', ps);
8406
8406
  } else if (tq instanceof yy.FuncValue) {
8407
- ps = "var res=alasql.from[" + JSON.stringify(tq.funcid.toUpperCase()) + "](";
8407
+ ps = 'var res=alasql.from[' + JSON.stringify(tq.funcid.toUpperCase()) + '](';
8408
8408
 
8409
8409
  if (tq.args && tq.args.length > 0) {
8410
8410
  if (tq.args[0]) {
@@ -8667,7 +8667,7 @@ yy.Select.prototype.compileJoins = function (query) {
8667
8667
  };
8668
8668
  // source.data = ;
8669
8669
 
8670
- var s = "var res=alasql.from[" + JSON.stringify(jn.func.funcid.toUpperCase()) + "](";
8670
+ var s = 'var res=alasql.from[' + JSON.stringify(jn.func.funcid.toUpperCase()) + '](';
8671
8671
 
8672
8672
  var args = jn.func.args;
8673
8673
  if (args && args.length > 0) {
@@ -10841,7 +10841,7 @@ yy.Op.prototype.toJS = function (context, tableid, defcols) {
10841
10841
  if (!(!this.right.args || 0 === this.right.args.length)) {
10842
10842
  var ss = this.right.args.map(ref);
10843
10843
  }
10844
- s = '' + ljs + "[" + JSON.stringify(this.right.funcid) + "](" + ss.join(',') + ')';
10844
+ s = '' + ljs + '[' + JSON.stringify(this.right.funcid) + '](' + ss.join(',') + ')';
10845
10845
  } else {
10846
10846
  s = '' + ljs + '[' + rightJS() + ']';
10847
10847
  }
@@ -11816,10 +11816,13 @@ stdlib.MIN = stdlib.LEAST = function () {
11816
11816
  );
11817
11817
  };
11818
11818
 
11819
- stdlib.SUBSTRING = stdlib.SUBSTR = stdlib.MID = function (a, b, c) {
11820
- if (arguments.length == 2) return und(a, 'y.substr(' + b + '-1)');
11821
- else if (arguments.length == 3) return und(a, 'y.substr(' + b + '-1,' + c + ')');
11822
- };
11819
+ stdlib.SUBSTRING =
11820
+ stdlib.SUBSTR =
11821
+ stdlib.MID =
11822
+ function (a, b, c) {
11823
+ if (arguments.length == 2) return und(a, 'y.substr(' + b + '-1)');
11824
+ else if (arguments.length == 3) return und(a, 'y.substr(' + b + '-1,' + c + ')');
11825
+ };
11823
11826
 
11824
11827
  stdfn.REGEXP_LIKE = function (a, b, c) {
11825
11828
 
@@ -12043,13 +12046,16 @@ alasql.aggr.VARP = function (v, s, stage) {
12043
12046
  }
12044
12047
  };
12045
12048
 
12046
- alasql.aggr.STD = alasql.aggr.STDDEV = alasql.aggr.STDEVP = function (v, s, stage) {
12047
- if (stage == 1 || stage == 2) {
12048
- return alasql.aggr.VARP(v, s, stage);
12049
- } else {
12050
- return Math.sqrt(alasql.aggr.VARP(v, s, stage));
12051
- }
12052
- };
12049
+ alasql.aggr.STD =
12050
+ alasql.aggr.STDDEV =
12051
+ alasql.aggr.STDEVP =
12052
+ function (v, s, stage) {
12053
+ if (stage == 1 || stage == 2) {
12054
+ return alasql.aggr.VARP(v, s, stage);
12055
+ } else {
12056
+ return Math.sqrt(alasql.aggr.VARP(v, s, stage));
12057
+ }
12058
+ };
12053
12059
 
12054
12060
  alasql._aggrOriginal = alasql.aggr;
12055
12061
  alasql.aggr = {};
@@ -12071,34 +12077,37 @@ for (var i = 0; i < 256; i++) {
12071
12077
  lut[i] = (i < 16 ? '0' : '') + i.toString(16);
12072
12078
  }
12073
12079
 
12074
- stdfn.NEWID = stdfn.UUID = stdfn.GEN_RANDOM_UUID = function () {
12075
- var d0 = (Math.random() * 0xffffffff) | 0;
12076
- var d1 = (Math.random() * 0xffffffff) | 0;
12077
- var d2 = (Math.random() * 0xffffffff) | 0;
12078
- var d3 = (Math.random() * 0xffffffff) | 0;
12079
- return (
12080
- lut[d0 & 0xff] +
12081
- lut[(d0 >> 8) & 0xff] +
12082
- lut[(d0 >> 16) & 0xff] +
12083
- lut[(d0 >> 24) & 0xff] +
12084
- '-' +
12085
- lut[d1 & 0xff] +
12086
- lut[(d1 >> 8) & 0xff] +
12087
- '-' +
12088
- lut[((d1 >> 16) & 0x0f) | 0x40] +
12089
- lut[(d1 >> 24) & 0xff] +
12090
- '-' +
12091
- lut[(d2 & 0x3f) | 0x80] +
12092
- lut[(d2 >> 8) & 0xff] +
12093
- '-' +
12094
- lut[(d2 >> 16) & 0xff] +
12095
- lut[(d2 >> 24) & 0xff] +
12096
- lut[d3 & 0xff] +
12097
- lut[(d3 >> 8) & 0xff] +
12098
- lut[(d3 >> 16) & 0xff] +
12099
- lut[(d3 >> 24) & 0xff]
12100
- );
12101
- };
12080
+ stdfn.NEWID =
12081
+ stdfn.UUID =
12082
+ stdfn.GEN_RANDOM_UUID =
12083
+ function () {
12084
+ var d0 = (Math.random() * 0xffffffff) | 0;
12085
+ var d1 = (Math.random() * 0xffffffff) | 0;
12086
+ var d2 = (Math.random() * 0xffffffff) | 0;
12087
+ var d3 = (Math.random() * 0xffffffff) | 0;
12088
+ return (
12089
+ lut[d0 & 0xff] +
12090
+ lut[(d0 >> 8) & 0xff] +
12091
+ lut[(d0 >> 16) & 0xff] +
12092
+ lut[(d0 >> 24) & 0xff] +
12093
+ '-' +
12094
+ lut[d1 & 0xff] +
12095
+ lut[(d1 >> 8) & 0xff] +
12096
+ '-' +
12097
+ lut[((d1 >> 16) & 0x0f) | 0x40] +
12098
+ lut[(d1 >> 24) & 0xff] +
12099
+ '-' +
12100
+ lut[(d2 & 0x3f) | 0x80] +
12101
+ lut[(d2 >> 8) & 0xff] +
12102
+ '-' +
12103
+ lut[(d2 >> 16) & 0xff] +
12104
+ lut[(d2 >> 24) & 0xff] +
12105
+ lut[d3 & 0xff] +
12106
+ lut[(d3 >> 8) & 0xff] +
12107
+ lut[(d3 >> 16) & 0xff] +
12108
+ lut[(d3 >> 24) & 0xff]
12109
+ );
12110
+ };
12102
12111
 
12103
12112
  /*
12104
12113
  //
@@ -17161,7 +17170,8 @@ alasql.into.XLSX = function (filename, opts, data, columns, cb) {
17161
17170
  var colm = 1,
17162
17171
  rowm = 1;
17163
17172
  }
17164
- var colmax = Math.max(col0 + columns.length, colm);
17173
+ var zeroColumnFix = columns.length ? 0 : 1;
17174
+ var colmax = Math.max(col0 + columns.length - 1 + zeroColumnFix, colm);
17165
17175
  var rowmax = Math.max(row0 + dataLength + 2, rowm);
17166
17176
 
17167
17177
  var i = row0 + 1;
@@ -19652,7 +19662,14 @@ var saveAs =
19652
19662
  FS_proto.WRITING = 1;
19653
19663
  FS_proto.DONE = 2;
19654
19664
 
19655
- FS_proto.error = FS_proto.onwritestart = FS_proto.onprogress = FS_proto.onwrite = FS_proto.onabort = FS_proto.onerror = FS_proto.onwriteend = null;
19665
+ FS_proto.error =
19666
+ FS_proto.onwritestart =
19667
+ FS_proto.onprogress =
19668
+ FS_proto.onwrite =
19669
+ FS_proto.onabort =
19670
+ FS_proto.onerror =
19671
+ FS_proto.onwriteend =
19672
+ null;
19656
19673
 
19657
19674
  return saveAs;
19658
19675
  })(