@xuda.io/xuda-worker-bundle-min 1.3.681 → 1.3.683

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.
Files changed (2) hide show
  1. package/index.js +18 -6
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -9018,7 +9018,6 @@ func.expression.get = async function (
9018
9018
  ) {
9019
9019
  ret = ret;
9020
9020
  } else {
9021
- // ret = secure_eval(ret); //eval(ret);
9022
9021
  ret = await func.expression.secure_eval(
9023
9022
  SESSION_ID,
9024
9023
  sourceP,
@@ -9273,7 +9272,7 @@ func.expression.get = async function (
9273
9272
  else res = [exp.result];
9274
9273
  fields = _.assignIn(exp.fields, fieldsP);
9275
9274
  }
9276
- var result = join(res); //res.join("");
9275
+ var result = join(res);
9277
9276
 
9278
9277
  if (res.length === 1) {
9279
9278
  // bypass join for single value expression
@@ -9291,7 +9290,7 @@ func.expression.get = async function (
9291
9290
  typeof res[0] !== "object"
9292
9291
  ) {
9293
9292
  // avoid eval when query leading zeros problem
9294
- ret = join(res); // res.join("");
9293
+ ret = join(res);
9295
9294
  if (ret && ret.substr(0, 1) === "@") {
9296
9295
  error = "Error encoding @ var";
9297
9296
  var_error_found = true;
@@ -9305,7 +9304,6 @@ func.expression.get = async function (
9305
9304
  "DbQuery",
9306
9305
  ].includes(sourceP)
9307
9306
  ) {
9308
- // ret = secure_eval(result); // eval(result);
9309
9307
  ret = await func.expression.secure_eval(
9310
9308
  SESSION_ID,
9311
9309
  sourceP,
@@ -9460,7 +9458,12 @@ func.expression.parse = function (strP) {
9460
9458
  func.expression.get_property = function (valP) {
9461
9459
  function secure_eval(val) {
9462
9460
  if (typeof IS_PROCESS_SERVER === "undefined") {
9463
- return eval(val);
9461
+ try {
9462
+ return eval(val);
9463
+ } catch (err) {
9464
+ console.error(err);
9465
+ return;
9466
+ }
9464
9467
  }
9465
9468
 
9466
9469
  try {
@@ -9542,7 +9545,16 @@ func.expression.secure_eval = async function (
9542
9545
  typeof IS_PROCESS_SERVER === "undefined" &&
9543
9546
  typeof IS_DOCKER === "undefined"
9544
9547
  ) {
9545
- return eval(val);
9548
+ try {
9549
+ return eval(val);
9550
+ } catch (err) {
9551
+ try {
9552
+ return JSON5.parse(val);
9553
+ } catch (err) {
9554
+ console.error(err);
9555
+ return;
9556
+ }
9557
+ }
9546
9558
  }
9547
9559
  // server side execution
9548
9560
  if (sourceP === "javascript") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.681",
3
+ "version": "1.3.683",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {