alasql 4.20.2 → 4.20.3

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/bin/alasql-cli.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  //
4
4
  // Command line interface for Alasql
5
- // Version: 4.20.2
5
+ // Version: 4.20.3
6
6
  // Date: 28.07.2015
7
7
  // (c) 2014-2022, Andrey Gershun & Mathias Wulff
8
8
  //
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.20.2 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.20.3 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.20.2
4
+ @version 4.20.3
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 Andrey Gershun & Mathias Wulff
package/dist/alasql.fs.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.20.2 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.20.3 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.20.2
4
+ @version 4.20.3
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ SOFTWARE.
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.20.2';
144
+ alasql.version = '4.20.3';
145
145
  alasql.build = 'develop-a98910ff';
146
146
 
147
147
  /**
@@ -3015,7 +3015,7 @@ next:function () {
3015
3015
 
3016
3016
  // return next match that has a token
3017
3017
  lex:function lex () {
3018
- var r = this.next();
3018
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
3019
3019
  if (r) {
3020
3020
  return r;
3021
3021
  } else {
@@ -7267,7 +7267,7 @@ function queryfn3(query) {
7267
7267
 
7268
7268
  // Prepare variables
7269
7269
  query.data = [];
7270
- query.xgroups = {};
7270
+ query.xgroups=Object.create(null);
7271
7271
  query.groups = [];
7272
7272
 
7273
7273
  // Level of Joins
@@ -8343,7 +8343,7 @@ yy.Select = class Select {
8343
8343
  var converted = {};
8344
8344
  for (var key in r) {
8345
8345
  var colDef = table.xcolumns && table.xcolumns[key];
8346
- converted[key] = alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);
8346
+ var cv=alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);if(key==="__proto__"){Object.defineProperty(converted,key,{value:cv,writable:true,enumerable:true,configurable:true})}else{converted[key]=cv}
8347
8347
  }
8348
8348
  table.data.push(converted);
8349
8349
  `;
@@ -17221,22 +17221,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
17221
17221
  if (this.props && this.props.length > 0) {
17222
17222
  let fs;
17223
17223
  if (this.method === '@') {
17224
- fs = `alasql.vars['${this.variable}']`;
17224
+ fs = `alasql.vars[k('${this.variable}')]`;
17225
17225
  } else {
17226
- fs = `params['${this.variable}']`;
17226
+ fs = `params[k('${this.variable}')]`;
17227
17227
  }
17228
17228
  this.props.forEach(prop => {
17229
17229
  if (typeof prop === 'string') {
17230
- fs += `['${prop}']`;
17230
+ fs += `[k('${prop}')]`;
17231
17231
  } else if (typeof prop === 'number') {
17232
17232
  fs += `[${prop}]`;
17233
17233
  } else {
17234
17234
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
17235
- fs += `[${prop.toJS()}]`;
17235
+ fs += `[k(${prop.toJS()})]`;
17236
17236
  }
17237
17237
  });
17238
17238
 
17239
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
17239
+ new Function('value, params, alasql', `var k=function(x){if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(x+" is not allowed");return x};${fs} = value`)(res, params, alasql);
17240
17240
  } else {
17241
17241
  if (this.method === '@') {
17242
17242
  alasql.vars[this.variable] = res;
package/dist/alasql.js CHANGED
@@ -1,7 +1,7 @@
1
- //! AlaSQL v4.20.2 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
1
+ //! AlaSQL v4.20.3 build: develop-a98910ff | © 2014-2025 Andrey Gershun & Mathias Wulff | License: MIT
2
2
  /*
3
3
  @module alasql
4
- @version 4.20.2
4
+ @version 4.20.3
5
5
 
6
6
  AlaSQL - JavaScript SQL database
7
7
  © 2014-2025 Andrey Gershun & Mathias Wulff
@@ -141,7 +141,7 @@ SOFTWARE.
141
141
  Current version of alasql
142
142
  @constant {string}
143
143
  */
144
- alasql.version = '4.20.2';
144
+ alasql.version = '4.20.3';
145
145
  alasql.build = 'develop-a98910ff';
146
146
 
147
147
  /**
@@ -3015,7 +3015,7 @@ next:function () {
3015
3015
 
3016
3016
  // return next match that has a token
3017
3017
  lex:function lex () {
3018
- var r = this.next();
3018
+ var r = this.next();if(r&&/^(N?['"]__proto__['"]|\[__proto__\]|`__proto__`|__proto__)$/i.test(this.yytext))throw new Error("__proto__ is not allowed");
3019
3019
  if (r) {
3020
3020
  return r;
3021
3021
  } else {
@@ -7267,7 +7267,7 @@ function queryfn3(query) {
7267
7267
 
7268
7268
  // Prepare variables
7269
7269
  query.data = [];
7270
- query.xgroups = {};
7270
+ query.xgroups=Object.create(null);
7271
7271
  query.groups = [];
7272
7272
 
7273
7273
  // Level of Joins
@@ -8343,7 +8343,7 @@ yy.Select = class Select {
8343
8343
  var converted = {};
8344
8344
  for (var key in r) {
8345
8345
  var colDef = table.xcolumns && table.xcolumns[key];
8346
- converted[key] = alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);
8346
+ var cv=alasql.utils.typeConverter(r[key], colDef ? colDef.dbtypeid : null);if(key==="__proto__"){Object.defineProperty(converted,key,{value:cv,writable:true,enumerable:true,configurable:true})}else{converted[key]=cv}
8347
8347
  }
8348
8348
  table.data.push(converted);
8349
8349
  `;
@@ -17221,22 +17221,22 @@ yy.SetVariable.prototype.execute = function (databaseid, params, cb) {
17221
17221
  if (this.props && this.props.length > 0) {
17222
17222
  let fs;
17223
17223
  if (this.method === '@') {
17224
- fs = `alasql.vars['${this.variable}']`;
17224
+ fs = `alasql.vars[k('${this.variable}')]`;
17225
17225
  } else {
17226
- fs = `params['${this.variable}']`;
17226
+ fs = `params[k('${this.variable}')]`;
17227
17227
  }
17228
17228
  this.props.forEach(prop => {
17229
17229
  if (typeof prop === 'string') {
17230
- fs += `['${prop}']`;
17230
+ fs += `[k('${prop}')]`;
17231
17231
  } else if (typeof prop === 'number') {
17232
17232
  fs += `[${prop}]`;
17233
17233
  } else {
17234
17234
  // Assuming prop.toJS() is a method that converts prop to a JavaScript expression.
17235
- fs += `[${prop.toJS()}]`;
17235
+ fs += `[k(${prop.toJS()})]`;
17236
17236
  }
17237
17237
  });
17238
17238
 
17239
- new Function('value, params, alasql', `${fs} = value`)(res, params, alasql);
17239
+ new Function('value, params, alasql', `var k=function(x){if(x==="__proto__"||x==="constructor"||x==="prototype")throw new Error(x+" is not allowed");return x};${fs} = value`)(res, params, alasql);
17240
17240
  } else {
17241
17241
  if (this.method === '@') {
17242
17242
  alasql.vars[this.variable] = res;