alasql 4.1.5 → 4.1.7
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.
- package/dist/alasql-worker.js +2 -2
- package/dist/alasql-worker.min.js +1 -1
- package/dist/alasql.fs.js +43 -34
- package/dist/alasql.js +43 -34
- package/dist/alasql.min.js +31 -25
- package/package.json +1 -1
package/dist/alasql-worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.1.
|
|
1
|
+
//! AlaSQL v4.1.6 build: develop-a1db25b2 | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.1.
|
|
4
|
+
@version 4.1.6
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
//! AlaSQL v4.1.
|
|
1
|
+
//! AlaSQL v4.1.6 build: develop-a1db25b2 | © 2014-2023 Andrey Gershun & Mathias 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 v4.1.
|
|
1
|
+
//! AlaSQL v4.1.6 build: develop-a1db25b2 | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.1.
|
|
4
|
+
@version 4.1.6
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
|
@@ -142,8 +142,8 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
142
142
|
Current version of alasql
|
|
143
143
|
@constant {string}
|
|
144
144
|
*/
|
|
145
|
-
alasql.version = '4.1.
|
|
146
|
-
alasql.build = 'develop-
|
|
145
|
+
alasql.version = '4.1.6';
|
|
146
|
+
alasql.build = 'develop-a1db25b2';
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
Debug flag
|
|
@@ -8716,18 +8716,18 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8716
8716
|
if (col.aggregatorid === 'SUM') {
|
|
8717
8717
|
if ('funcid' in col.expression) {
|
|
8718
8718
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8719
|
-
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${
|
|
8719
|
+
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${colexp} : null,`;
|
|
8720
8720
|
}
|
|
8721
8721
|
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ? ${colexp} : null,`;
|
|
8722
8722
|
} else if (col.aggregatorid === 'TOTAL') {
|
|
8723
8723
|
if ('funcid' in col.expression) {
|
|
8724
8724
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8725
|
-
return `'${colas}':(${colexp1}) || typeof ${colexp1} == 'number' ?
|
|
8726
|
-
${colexp1} : ${colexp1} == 'string' && typeof Number(${colexp1}) == 'number' ? Number(${colexp1}) :
|
|
8725
|
+
return `'${colas}':(${colexp1}) || typeof ${colexp1} == 'number' ?
|
|
8726
|
+
${colexp1} : ${colexp1} == 'string' && typeof Number(${colexp1}) == 'number' ? Number(${colexp1}) :
|
|
8727
8727
|
typeof ${colexp1} == 'boolean' ? Number(${colexp1}) : 0,`;
|
|
8728
8728
|
}
|
|
8729
|
-
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ?
|
|
8730
|
-
${colexp} : ${colexp} == 'string' && typeof Number(${colexp}) == 'number' ? Number(${colexp}) :
|
|
8729
|
+
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ?
|
|
8730
|
+
${colexp} : ${colexp} == 'string' && typeof Number(${colexp}) == 'number' ? Number(${colexp}) :
|
|
8731
8731
|
typeof ${colexp} === 'boolean' ? Number(${colexp}) : 0,`;
|
|
8732
8732
|
} else if (
|
|
8733
8733
|
col.aggregatorid === 'FIRST' ||
|
|
@@ -8739,18 +8739,19 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8739
8739
|
} else if (col.aggregatorid === 'MIN') {
|
|
8740
8740
|
if ('funcid' in col.expression) {
|
|
8741
8741
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8742
|
-
|
|
8743
|
-
typeof
|
|
8742
|
+
|
|
8743
|
+
return(`'${colas}': (typeof ${colexp1} == 'number' ? ${colexp} : typeof ${colexp1} == 'object' ?
|
|
8744
|
+
typeof Number(${colexp1}) == 'number' && ${colexp1}!== null? ${colexp} : null : null),`);
|
|
8744
8745
|
}
|
|
8745
|
-
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8746
|
+
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8746
8747
|
typeof Number(${colexp}) == 'number' && ${colexp}!== null? ${colexp} : null : null),`;
|
|
8747
8748
|
} else if (col.aggregatorid === 'MAX') {
|
|
8748
8749
|
if ('funcid' in col.expression) {
|
|
8749
8750
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8750
|
-
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${
|
|
8751
|
-
typeof Number(${colexp1}) == 'number' ? ${
|
|
8751
|
+
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${colexp} : typeof ${colexp1} == 'object' ?
|
|
8752
|
+
typeof Number(${colexp1}) == 'number' ? ${colexp} : null : null),`;
|
|
8752
8753
|
}
|
|
8753
|
-
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8754
|
+
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8754
8755
|
typeof Number(${colexp}) == 'number' ? ${colexp} : null : null),`;
|
|
8755
8756
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8756
8757
|
return "'" + colas + "':[" + colexp + '],';
|
|
@@ -8846,18 +8847,18 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8846
8847
|
pre +
|
|
8847
8848
|
`if(g['${colas}'] == null && ${colexp1} == null){g['${colas}'] = null}
|
|
8848
8849
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'object' && typeof ${colexp1}!== 'number'){g['${colas}'] = null}
|
|
8849
|
-
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${
|
|
8850
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp}}
|
|
8850
8851
|
else if(typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8851
8852
|
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp1} == null || (typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'))){g['${colas}'] = null}
|
|
8852
8853
|
else if(typeof g['${colas}'] == 'number' && typeof ${colexp1} ==null){g['${colas}'] = g['${colas}']}
|
|
8853
|
-
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${
|
|
8854
|
-
else{g['${colas}'] += ${
|
|
8854
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${colexp}}
|
|
8855
|
+
else{g['${colas}'] += ${colexp}||0}` +
|
|
8855
8856
|
post
|
|
8856
8857
|
);
|
|
8857
8858
|
}
|
|
8858
8859
|
return (
|
|
8859
8860
|
pre +
|
|
8860
|
-
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8861
|
+
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8861
8862
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number'&& typeof ${colexp}!== 'object' && typeof ${colexp}!== 'number'){g['${colas}'] = null}
|
|
8862
8863
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
8863
8864
|
else if(typeof g['${colas}']!== 'number' && typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
@@ -8872,7 +8873,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8872
8873
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8873
8874
|
return (
|
|
8874
8875
|
pre +
|
|
8875
|
-
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8876
|
+
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8876
8877
|
typeof ${colexp1} == 'string' && !isNaN(${colexp1}) && typeof Number(${colexp1}) == 'number'){g['${colas}'] = Number(g['${colas}']) + Number(${colexp1})}
|
|
8877
8878
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp1} == 'string'){g['${colas}'] = 0}
|
|
8878
8879
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp1}}
|
|
@@ -8883,7 +8884,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8883
8884
|
}
|
|
8884
8885
|
return (
|
|
8885
8886
|
pre +
|
|
8886
|
-
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8887
|
+
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8887
8888
|
typeof ${colexp} == 'string' && !isNaN(${colexp}) && typeof Number(${colexp}) == 'number'){g['${colas}'] = Number(g['${colas}']) + Number(${colexp})}
|
|
8888
8889
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp} == 'string'){g['${colas}'] = 0}
|
|
8889
8890
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
@@ -8913,43 +8914,51 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8913
8914
|
} else if (col.aggregatorid === 'MIN') {
|
|
8914
8915
|
if ('funcid' in col.expression) {
|
|
8915
8916
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8916
|
-
|
|
8917
|
+
|
|
8918
|
+
return(
|
|
8917
8919
|
pre +
|
|
8918
|
-
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${
|
|
8919
|
-
${colexp1} == null) ? y = g['${colas}']:((y=${
|
|
8920
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8921
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8920
8922
|
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8921
8923
|
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8922
|
-
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8924
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8923
8925
|
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8924
8926
|
post
|
|
8925
8927
|
);
|
|
8926
8928
|
}
|
|
8927
8929
|
return (
|
|
8928
8930
|
pre +
|
|
8929
|
-
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8931
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8930
8932
|
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8931
8933
|
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8932
8934
|
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8933
|
-
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8935
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8934
8936
|
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8935
8937
|
post
|
|
8936
8938
|
);
|
|
8937
8939
|
} else if (col.aggregatorid === 'MAX') {
|
|
8938
8940
|
if ('funcid' in col.expression) {
|
|
8939
8941
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8940
|
-
|
|
8942
|
+
|
|
8943
|
+
return(
|
|
8941
8944
|
pre +
|
|
8942
|
-
`if((
|
|
8943
|
-
|
|
8944
|
-
else if(typeof y == 'object' &&
|
|
8945
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8946
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp}) > g['${colas}'])){ if(typeof y == 'number')
|
|
8947
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8948
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8949
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8950
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8945
8951
|
post
|
|
8946
8952
|
);
|
|
8947
8953
|
}
|
|
8948
8954
|
return (
|
|
8949
8955
|
pre +
|
|
8950
|
-
`if((
|
|
8951
|
-
|
|
8952
|
-
else if(typeof y == 'object' &&
|
|
8956
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8957
|
+
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) > g['${colas}'])){ if(typeof y == 'number')
|
|
8958
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8959
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8960
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8961
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8953
8962
|
post
|
|
8954
8963
|
);
|
|
8955
8964
|
} else if (col.aggregatorid === 'FIRST') {
|
package/dist/alasql.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
//! AlaSQL v4.1.
|
|
1
|
+
//! AlaSQL v4.1.6 build: develop-a1db25b2 | © 2014-2023 Andrey Gershun & Mathias Wulff | License: MIT
|
|
2
2
|
/*
|
|
3
3
|
@module alasql
|
|
4
|
-
@version 4.1.
|
|
4
|
+
@version 4.1.6
|
|
5
5
|
|
|
6
6
|
AlaSQL - JavaScript SQL database
|
|
7
7
|
© 2014-2023 Andrey Gershun & Mathias Wulff
|
|
@@ -142,8 +142,8 @@ var alasql = function(sql, params, cb, scope) {
|
|
|
142
142
|
Current version of alasql
|
|
143
143
|
@constant {string}
|
|
144
144
|
*/
|
|
145
|
-
alasql.version = '4.1.
|
|
146
|
-
alasql.build = 'develop-
|
|
145
|
+
alasql.version = '4.1.6';
|
|
146
|
+
alasql.build = 'develop-a1db25b2';
|
|
147
147
|
|
|
148
148
|
/**
|
|
149
149
|
Debug flag
|
|
@@ -8716,18 +8716,18 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8716
8716
|
if (col.aggregatorid === 'SUM') {
|
|
8717
8717
|
if ('funcid' in col.expression) {
|
|
8718
8718
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8719
|
-
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${
|
|
8719
|
+
return `'${colas}':(${colexp1})|| typeof ${colexp1} == 'number' ? ${colexp} : null,`;
|
|
8720
8720
|
}
|
|
8721
8721
|
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ? ${colexp} : null,`;
|
|
8722
8722
|
} else if (col.aggregatorid === 'TOTAL') {
|
|
8723
8723
|
if ('funcid' in col.expression) {
|
|
8724
8724
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8725
|
-
return `'${colas}':(${colexp1}) || typeof ${colexp1} == 'number' ?
|
|
8726
|
-
${colexp1} : ${colexp1} == 'string' && typeof Number(${colexp1}) == 'number' ? Number(${colexp1}) :
|
|
8725
|
+
return `'${colas}':(${colexp1}) || typeof ${colexp1} == 'number' ?
|
|
8726
|
+
${colexp1} : ${colexp1} == 'string' && typeof Number(${colexp1}) == 'number' ? Number(${colexp1}) :
|
|
8727
8727
|
typeof ${colexp1} == 'boolean' ? Number(${colexp1}) : 0,`;
|
|
8728
8728
|
}
|
|
8729
|
-
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ?
|
|
8730
|
-
${colexp} : ${colexp} == 'string' && typeof Number(${colexp}) == 'number' ? Number(${colexp}) :
|
|
8729
|
+
return `'${colas}':(${colexp})|| typeof ${colexp} == 'number' ?
|
|
8730
|
+
${colexp} : ${colexp} == 'string' && typeof Number(${colexp}) == 'number' ? Number(${colexp}) :
|
|
8731
8731
|
typeof ${colexp} === 'boolean' ? Number(${colexp}) : 0,`;
|
|
8732
8732
|
} else if (
|
|
8733
8733
|
col.aggregatorid === 'FIRST' ||
|
|
@@ -8739,18 +8739,19 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8739
8739
|
} else if (col.aggregatorid === 'MIN') {
|
|
8740
8740
|
if ('funcid' in col.expression) {
|
|
8741
8741
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8742
|
-
|
|
8743
|
-
typeof
|
|
8742
|
+
|
|
8743
|
+
return(`'${colas}': (typeof ${colexp1} == 'number' ? ${colexp} : typeof ${colexp1} == 'object' ?
|
|
8744
|
+
typeof Number(${colexp1}) == 'number' && ${colexp1}!== null? ${colexp} : null : null),`);
|
|
8744
8745
|
}
|
|
8745
|
-
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8746
|
+
return `'${colas}': (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8746
8747
|
typeof Number(${colexp}) == 'number' && ${colexp}!== null? ${colexp} : null : null),`;
|
|
8747
8748
|
} else if (col.aggregatorid === 'MAX') {
|
|
8748
8749
|
if ('funcid' in col.expression) {
|
|
8749
8750
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8750
|
-
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${
|
|
8751
|
-
typeof Number(${colexp1}) == 'number' ? ${
|
|
8751
|
+
return `'${colas}' : (typeof ${colexp1} == 'number' ? ${colexp} : typeof ${colexp1} == 'object' ?
|
|
8752
|
+
typeof Number(${colexp1}) == 'number' ? ${colexp} : null : null),`;
|
|
8752
8753
|
}
|
|
8753
|
-
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8754
|
+
return `'${colas}' : (typeof ${colexp} == 'number' ? ${colexp} : typeof ${colexp} == 'object' ?
|
|
8754
8755
|
typeof Number(${colexp}) == 'number' ? ${colexp} : null : null),`;
|
|
8755
8756
|
} else if (col.aggregatorid === 'ARRAY') {
|
|
8756
8757
|
return "'" + colas + "':[" + colexp + '],';
|
|
@@ -8846,18 +8847,18 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8846
8847
|
pre +
|
|
8847
8848
|
`if(g['${colas}'] == null && ${colexp1} == null){g['${colas}'] = null}
|
|
8848
8849
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'object' && typeof ${colexp1}!== 'number'){g['${colas}'] = null}
|
|
8849
|
-
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${
|
|
8850
|
+
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp}}
|
|
8850
8851
|
else if(typeof g['${colas}']!== 'number' && typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
8851
8852
|
else if((g['${colas}'] == null || (typeof g['${colas}']!== 'number' && typeof g['${colas}']!== 'object')) && (${colexp1} == null || (typeof ${colexp1}!== 'number' && typeof ${colexp1}!== 'object'))){g['${colas}'] = null}
|
|
8852
8853
|
else if(typeof g['${colas}'] == 'number' && typeof ${colexp1} ==null){g['${colas}'] = g['${colas}']}
|
|
8853
|
-
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${
|
|
8854
|
-
else{g['${colas}'] += ${
|
|
8854
|
+
else if(typeof g['${colas}'] == null && typeof ${colexp1} =='number'){g['${colas}'] = ${colexp}}
|
|
8855
|
+
else{g['${colas}'] += ${colexp}||0}` +
|
|
8855
8856
|
post
|
|
8856
8857
|
);
|
|
8857
8858
|
}
|
|
8858
8859
|
return (
|
|
8859
8860
|
pre +
|
|
8860
|
-
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8861
|
+
`if(g['${colas}'] == null && ${colexp} == null){g['${colas}'] = null}
|
|
8861
8862
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number'&& typeof ${colexp}!== 'object' && typeof ${colexp}!== 'number'){g['${colas}'] = null}
|
|
8862
8863
|
else if(typeof g['${colas}']!== 'object' && typeof g['${colas}']!== 'number' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
8863
8864
|
else if(typeof g['${colas}']!== 'number' && typeof ${colexp}!== 'number' && typeof ${colexp}!== 'object'){g['${colas}'] = g['${colas}']}
|
|
@@ -8872,7 +8873,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8872
8873
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8873
8874
|
return (
|
|
8874
8875
|
pre +
|
|
8875
|
-
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8876
|
+
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8876
8877
|
typeof ${colexp1} == 'string' && !isNaN(${colexp1}) && typeof Number(${colexp1}) == 'number'){g['${colas}'] = Number(g['${colas}']) + Number(${colexp1})}
|
|
8877
8878
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp1} == 'string'){g['${colas}'] = 0}
|
|
8878
8879
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp1} == 'number'){g['${colas}'] = ${colexp1}}
|
|
@@ -8883,7 +8884,7 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8883
8884
|
}
|
|
8884
8885
|
return (
|
|
8885
8886
|
pre +
|
|
8886
|
-
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8887
|
+
`if(typeof g['${colas}'] == 'string' && !isNaN(g['${colas}']) && typeof Number(g['${colas}']) == 'number' &&
|
|
8887
8888
|
typeof ${colexp} == 'string' && !isNaN(${colexp}) && typeof Number(${colexp}) == 'number'){g['${colas}'] = Number(g['${colas}']) + Number(${colexp})}
|
|
8888
8889
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp} == 'string'){g['${colas}'] = 0}
|
|
8889
8890
|
else if(typeof g['${colas}'] == 'string' && typeof ${colexp} == 'number'){g['${colas}'] = ${colexp}}
|
|
@@ -8913,43 +8914,51 @@ yy.Select.prototype.compileGroup = function (query) {
|
|
|
8913
8914
|
} else if (col.aggregatorid === 'MIN') {
|
|
8914
8915
|
if ('funcid' in col.expression) {
|
|
8915
8916
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8916
|
-
|
|
8917
|
+
|
|
8918
|
+
return(
|
|
8917
8919
|
pre +
|
|
8918
|
-
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${
|
|
8919
|
-
${colexp1} == null) ? y = g['${colas}']:((y=${
|
|
8920
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8921
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8920
8922
|
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8921
8923
|
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8922
|
-
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8924
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8923
8925
|
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8924
8926
|
post
|
|
8925
8927
|
);
|
|
8926
8928
|
}
|
|
8927
8929
|
return (
|
|
8928
8930
|
pre +
|
|
8929
|
-
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8931
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8930
8932
|
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) < g['${colas}'])){ if(typeof y == 'number')
|
|
8931
8933
|
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8932
8934
|
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8933
|
-
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8935
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8934
8936
|
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8935
8937
|
post
|
|
8936
8938
|
);
|
|
8937
8939
|
} else if (col.aggregatorid === 'MAX') {
|
|
8938
8940
|
if ('funcid' in col.expression) {
|
|
8939
8941
|
let colexp1 = colExpIfFunIdExists(col.expression);
|
|
8940
|
-
|
|
8942
|
+
|
|
8943
|
+
return(
|
|
8941
8944
|
pre +
|
|
8942
|
-
`if((
|
|
8943
|
-
|
|
8944
|
-
else if(typeof y == 'object' &&
|
|
8945
|
+
`if((g['${colas}'] == null && ${colexp1}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8946
|
+
${colexp1} == null) ? y = g['${colas}']:((y=${colexp}) > g['${colas}'])){ if(typeof y == 'number')
|
|
8947
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8948
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8949
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8950
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8945
8951
|
post
|
|
8946
8952
|
);
|
|
8947
8953
|
}
|
|
8948
8954
|
return (
|
|
8949
8955
|
pre +
|
|
8950
|
-
`if((
|
|
8951
|
-
|
|
8952
|
-
else if(typeof y == 'object' &&
|
|
8956
|
+
`if((g['${colas}'] == null && ${colexp}!== null) ? y = ${colexp} : (g['${colas}']!== null &&
|
|
8957
|
+
${colexp} == null) ? y = g['${colas}']:((y=${colexp}) > g['${colas}'])){ if(typeof y == 'number')
|
|
8958
|
+
{g['${colas}'] = y;}else if(typeof y == 'object' && y instanceof Date){g['${colas}'] = y;}
|
|
8959
|
+
else if(typeof y == 'object' && typeof Number(y) == 'number'){g['${colas}'] = Number(y);}}
|
|
8960
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object' && y instanceof Date){g['${colas}'] = g['${colas}']}
|
|
8961
|
+
else if(g['${colas}']!== null && typeof g['${colas}'] == 'object'){g['${colas}'] = Number(g['${colas}'])}` +
|
|
8953
8962
|
post
|
|
8954
8963
|
);
|
|
8955
8964
|
} else if (col.aggregatorid === 'FIRST') {
|