@xuda.io/xuda-worker-bundle-min 1.3.2448 → 1.3.2450

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 +20 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -9275,6 +9275,25 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
9275
9275
 
9276
9276
  // var split = [];
9277
9277
  var var_Arr = [];
9278
+ const get_iterate_value_ret = function (fieldIdP) {
9279
+ if (!iterate_info || (iterate_info.iterator_key !== fieldIdP && iterate_info.iterator_val !== fieldIdP)) {
9280
+ return null;
9281
+ }
9282
+
9283
+ const iter_value = iterate_info.iterator_key === fieldIdP ? iterate_info._key : iterate_info._val;
9284
+ const iter_type = typeof iter_value !== 'undefined' ? {}.toString.call(iter_value).match(/\s([a-zA-Z]+)/)[1].toLowerCase() : 'string';
9285
+
9286
+ return {
9287
+ ret: {
9288
+ value: iter_value,
9289
+ type: iter_type,
9290
+ prop: ['array', 'object'].includes(iter_type) ? iter_value : null,
9291
+ },
9292
+ fieldIdP,
9293
+ currentRecordId: rowIdP,
9294
+ found: typeof iter_value !== 'undefined',
9295
+ };
9296
+ };
9278
9297
  const split = func.expression.parse(ret) || [];
9279
9298
  // console.log(valP, split);
9280
9299
  const split_entries = Object.entries(split);
@@ -9371,7 +9390,7 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
9371
9390
  } // put default
9372
9391
  fields[val.fieldId] = var_Arr[key].value;
9373
9392
 
9374
- const ret = await func.datasource.get_value(SESSION_ID, val.fieldId, dsSessionP, rowIdP); // find field in dataSources
9393
+ const ret = get_iterate_value_ret(val.fieldId) || (await func.datasource.get_value(SESSION_ID, val.fieldId, dsSessionP, rowIdP)); // find field in dataSources
9375
9394
 
9376
9395
  await replace_value_in_string(ret.ret, ret.fieldIdP);
9377
9396
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuda.io/xuda-worker-bundle-min",
3
- "version": "1.3.2448",
3
+ "version": "1.3.2450",
4
4
  "description": "xuda framework min",
5
5
  "main": "index.js",
6
6
  "scripts": {