@xuda.io/runtime-bundle 1.0.481 → 1.0.482
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/js/xuda-runtime-bundle.js +150 -95
- package/js/xuda-runtime-bundle.min.js +1 -1
- package/js/xuda-runtime-slim.js +150 -95
- package/js/xuda-runtime-slim.min.es.js +150 -95
- package/js/xuda-runtime-slim.min.js +1 -1
- package/js/xuda-server-bundle.min.mjs +1 -1
- package/js/xuda-server-bundle.mjs +150 -95
- package/js/xuda-worker-bundle.js +150 -95
- package/js/xuda-worker-bundle.min.js +1 -1
- package/package.json +1 -1
|
@@ -35248,102 +35248,102 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
|
|
|
35248
35248
|
return new_class.get();
|
|
35249
35249
|
};
|
|
35250
35250
|
|
|
35251
|
-
|
|
35252
|
-
|
|
35253
|
-
|
|
35254
|
-
|
|
35255
|
-
|
|
35256
|
-
|
|
35257
|
-
|
|
35258
|
-
|
|
35259
|
-
|
|
35260
|
-
|
|
35261
|
-
|
|
35262
|
-
|
|
35263
|
-
|
|
35264
|
-
|
|
35265
|
-
|
|
35266
|
-
|
|
35267
|
-
|
|
35268
|
-
|
|
35269
|
-
|
|
35270
|
-
|
|
35271
|
-
|
|
35272
|
-
//
|
|
35273
|
-
|
|
35274
|
-
|
|
35275
|
-
|
|
35276
|
-
|
|
35277
|
-
|
|
35278
|
-
|
|
35279
|
-
//
|
|
35280
|
-
|
|
35281
|
-
|
|
35282
|
-
|
|
35283
|
-
|
|
35284
|
-
|
|
35285
|
-
|
|
35286
|
-
|
|
35287
|
-
|
|
35288
|
-
|
|
35289
|
-
|
|
35290
|
-
|
|
35291
|
-
|
|
35292
|
-
|
|
35293
|
-
|
|
35294
|
-
|
|
35295
|
-
//
|
|
35296
|
-
|
|
35297
|
-
//
|
|
35298
|
-
//
|
|
35299
|
-
|
|
35300
|
-
//
|
|
35301
|
-
|
|
35302
|
-
|
|
35303
|
-
|
|
35304
|
-
|
|
35305
|
-
|
|
35306
|
-
|
|
35307
|
-
|
|
35308
|
-
|
|
35309
|
-
|
|
35310
|
-
//
|
|
35311
|
-
|
|
35312
|
-
|
|
35313
|
-
|
|
35314
|
-
|
|
35315
|
-
//
|
|
35316
|
-
|
|
35317
|
-
|
|
35318
|
-
|
|
35319
|
-
|
|
35320
|
-
|
|
35321
|
-
//
|
|
35322
|
-
//
|
|
35323
|
-
//
|
|
35324
|
-
|
|
35325
|
-
|
|
35326
|
-
|
|
35327
|
-
|
|
35328
|
-
|
|
35329
|
-
|
|
35330
|
-
|
|
35331
|
-
|
|
35332
|
-
|
|
35333
|
-
|
|
35334
|
-
|
|
35335
|
-
|
|
35336
|
-
|
|
35337
|
-
|
|
35338
|
-
|
|
35339
|
-
|
|
35340
|
-
|
|
35341
|
-
|
|
35342
|
-
|
|
35343
|
-
|
|
35344
|
-
|
|
35251
|
+
func.expression.parse_org = function (strP) {
|
|
35252
|
+
var extract_str = function (strP, posP) {
|
|
35253
|
+
if (!posP) posP = 0;
|
|
35254
|
+
var clean_split_str = function (arrP) {
|
|
35255
|
+
var arr = [];
|
|
35256
|
+
if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
|
|
35257
|
+
for (var i = 1; i <= arrP.length; i++) {
|
|
35258
|
+
arr.push(arrP[i]);
|
|
35259
|
+
}
|
|
35260
|
+
return arr;
|
|
35261
|
+
} else return arrP;
|
|
35262
|
+
};
|
|
35263
|
+
var nonLettersPatt = /\W/; // non letters
|
|
35264
|
+
var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
|
|
35265
|
+
var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
|
|
35266
|
+
var validSymbols = validSymbolsNoArray;
|
|
35267
|
+
var splitTmp = strP.replace(/@/g, '^^@').split('^^');
|
|
35268
|
+
var split = clean_split_str(splitTmp);
|
|
35269
|
+
var obj = [];
|
|
35270
|
+
if (split) {
|
|
35271
|
+
for (let val of split) {
|
|
35272
|
+
// run on @ segments
|
|
35273
|
+
if (val) {
|
|
35274
|
+
var pos = strP.indexOf(val);
|
|
35275
|
+
if (val && val.substr(0, 1) === '@') {
|
|
35276
|
+
var tmpStr = '';
|
|
35277
|
+
var word_start_pos = undefined;
|
|
35278
|
+
var word_end_pos = undefined;
|
|
35279
|
+
// run on @ segment string
|
|
35280
|
+
for (var i = 0; i <= val.length; i++) {
|
|
35281
|
+
var key1 = i;
|
|
35282
|
+
var val1 = val.substr(i, 1);
|
|
35283
|
+
if (
|
|
35284
|
+
val1 === '.' &&
|
|
35285
|
+
!word_start_pos // find first dot
|
|
35286
|
+
)
|
|
35287
|
+
word_start_pos = key1;
|
|
35288
|
+
if (
|
|
35289
|
+
word_start_pos &&
|
|
35290
|
+
key1 > word_start_pos &&
|
|
35291
|
+
nonLettersPatt.test(val1) // find any sign character to mark the end of word
|
|
35292
|
+
)
|
|
35293
|
+
word_end_pos = key1;
|
|
35294
|
+
if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
|
|
35295
|
+
// find the word
|
|
35296
|
+
var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
|
|
35297
|
+
// if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
|
|
35298
|
+
// compare with internal properties
|
|
35299
|
+
tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
|
|
35300
|
+
// }
|
|
35301
|
+
if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
|
|
35302
|
+
else word_start_pos = null;
|
|
35303
|
+
word_end_pos = null;
|
|
35304
|
+
}
|
|
35305
|
+
if (val1 === '[') validSymbols = validSymbolsWithArray;
|
|
35306
|
+
if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
|
|
35307
|
+
tmpStr += '^^' + val1;
|
|
35308
|
+
} else tmpStr += val1;
|
|
35309
|
+
}
|
|
35310
|
+
// });
|
|
35311
|
+
if (tmpStr.indexOf('^^') > -1) {
|
|
35312
|
+
var obj1 = extract_str(tmpStr, pos);
|
|
35313
|
+
obj = obj.concat(obj1);
|
|
35314
|
+
} else {
|
|
35315
|
+
// push clean @var
|
|
35316
|
+
var fieldId = undefined;
|
|
35317
|
+
if (val) {
|
|
35318
|
+
fieldId = val.substr(1, val.length);
|
|
35319
|
+
if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
|
|
35320
|
+
if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
|
|
35321
|
+
//
|
|
35322
|
+
// if (val.indexOf("]") > -1)
|
|
35323
|
+
// fieldId = val.substr(1, val.indexOf("]") - 1);
|
|
35324
|
+
}
|
|
35325
|
+
obj.push({
|
|
35326
|
+
value: val,
|
|
35327
|
+
fieldId: fieldId,
|
|
35328
|
+
pos: pos + posP,
|
|
35329
|
+
});
|
|
35330
|
+
}
|
|
35331
|
+
} else {
|
|
35332
|
+
obj.push({
|
|
35333
|
+
value: val,
|
|
35334
|
+
pos: pos + posP,
|
|
35335
|
+
});
|
|
35336
|
+
}
|
|
35337
|
+
}
|
|
35338
|
+
}
|
|
35339
|
+
return obj;
|
|
35340
|
+
}
|
|
35341
|
+
};
|
|
35342
|
+
var res = extract_str(strP);
|
|
35343
|
+
return res;
|
|
35344
|
+
};
|
|
35345
35345
|
|
|
35346
|
-
func.expression.
|
|
35346
|
+
func.expression.parse_bad = function (strP) {
|
|
35347
35347
|
const nonLettersPatt = /\W/;
|
|
35348
35348
|
const validSymbolsNoArray = /[^.@\[]/;
|
|
35349
35349
|
const validSymbolsWithArray = /[^.@"'\[\]]/;
|
|
@@ -35401,6 +35401,61 @@ func.expression.parse = function (strP) {
|
|
|
35401
35401
|
return extractStr(strP);
|
|
35402
35402
|
};
|
|
35403
35403
|
|
|
35404
|
+
func.expression.parse = function (input) {
|
|
35405
|
+
if (typeof input !== 'string') return [];
|
|
35406
|
+
|
|
35407
|
+
const segments = [];
|
|
35408
|
+
let pos = 0;
|
|
35409
|
+
|
|
35410
|
+
const parts = input.split(/(@)/).filter(Boolean);
|
|
35411
|
+
|
|
35412
|
+
for (let i = 0; i < parts.length; i++) {
|
|
35413
|
+
const part = parts[i];
|
|
35414
|
+
|
|
35415
|
+
if (part === '@' && i + 1 < parts.length) {
|
|
35416
|
+
const nextPart = parts[i + 1];
|
|
35417
|
+
const varEnd = nextPart.search(/[.\[]/); // Split at first . or [
|
|
35418
|
+
let fieldId, remainder;
|
|
35419
|
+
|
|
35420
|
+
if (varEnd > 0) {
|
|
35421
|
+
fieldId = nextPart.slice(0, varEnd);
|
|
35422
|
+
remainder = nextPart.slice(varEnd);
|
|
35423
|
+
} else {
|
|
35424
|
+
fieldId = nextPart;
|
|
35425
|
+
remainder = '';
|
|
35426
|
+
}
|
|
35427
|
+
|
|
35428
|
+
// Add @variable segment
|
|
35429
|
+
const fullVarValue = `@${fieldId}`;
|
|
35430
|
+
segments.push({
|
|
35431
|
+
value: fullVarValue,
|
|
35432
|
+
fieldId,
|
|
35433
|
+
pos,
|
|
35434
|
+
});
|
|
35435
|
+
pos += fullVarValue.length;
|
|
35436
|
+
|
|
35437
|
+
// Add remainder as a separate segment, if any
|
|
35438
|
+
if (remainder) {
|
|
35439
|
+
segments.push({
|
|
35440
|
+
value: remainder,
|
|
35441
|
+
pos,
|
|
35442
|
+
});
|
|
35443
|
+
pos += remainder.length;
|
|
35444
|
+
}
|
|
35445
|
+
|
|
35446
|
+
i++; // Skip the next part since we consumed it
|
|
35447
|
+
} else if (part !== '@') {
|
|
35448
|
+
segments.push({
|
|
35449
|
+
value: part,
|
|
35450
|
+
pos,
|
|
35451
|
+
});
|
|
35452
|
+
pos += part.length;
|
|
35453
|
+
}
|
|
35454
|
+
}
|
|
35455
|
+
|
|
35456
|
+
return segments;
|
|
35457
|
+
};
|
|
35458
|
+
|
|
35404
35459
|
func.expression.get_property = async function (valP) {
|
|
35405
35460
|
async function secure_eval(val) {
|
|
35406
35461
|
if (typeof IS_PROCESS_SERVER === 'undefined') {
|