@dra2020/baseclient 1.0.145 → 1.0.147
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/baseclient.js +12 -7
- package/dist/baseclient.js.map +1 -1
- package/lib/detail/detail.ts +10 -5
- package/lib/util/util.ts +2 -2
- package/package.json +1 -1
package/dist/baseclient.js
CHANGED
|
@@ -1245,8 +1245,8 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
|
1245
1245
|
exports.FormatDetail = void 0;
|
|
1246
1246
|
const Util = __importStar(__webpack_require__(/*! ../util/all */ "./lib/util/all.ts"));
|
|
1247
1247
|
//import { Util } from '@dra2020/baseclient';
|
|
1248
|
-
const
|
|
1249
|
-
const
|
|
1248
|
+
const reIdentifierOrStringOrNumber = /([a-zA-Z0-9_$][a-zA-Z0-9_$]*)|(['"])(?:(?=(\\?))\3.)*?\2/g;
|
|
1249
|
+
const reNumber = /[0-9][0-9]*/;
|
|
1250
1250
|
const reParam = /^__\d+$/;
|
|
1251
1251
|
const reString = /^['"]/;
|
|
1252
1252
|
// Number format: (locale|general|integer|currency).precision
|
|
@@ -1284,9 +1284,11 @@ class Evaluator {
|
|
|
1284
1284
|
let safeexpr = this.expr;
|
|
1285
1285
|
let safenames = names.map(n => namemap[n]);
|
|
1286
1286
|
// Replace valid identifiers with safe version
|
|
1287
|
-
safeexpr = safeexpr.replace(
|
|
1287
|
+
safeexpr = safeexpr.replace(reIdentifierOrStringOrNumber, (match) => {
|
|
1288
1288
|
if (namemap[match])
|
|
1289
1289
|
return namemap[match];
|
|
1290
|
+
else if (reNumber.test(match))
|
|
1291
|
+
return match;
|
|
1290
1292
|
else if (match === '__format' || reString.test(match))
|
|
1291
1293
|
return match;
|
|
1292
1294
|
else {
|
|
@@ -1295,8 +1297,11 @@ class Evaluator {
|
|
|
1295
1297
|
}
|
|
1296
1298
|
});
|
|
1297
1299
|
// Remove any identifiers that aren't the simple parameters to prevent out-of-sandbox execution
|
|
1298
|
-
safeexpr = safeexpr.replace(
|
|
1299
|
-
let valid = reParam.test(match)
|
|
1300
|
+
safeexpr = safeexpr.replace(reIdentifierOrStringOrNumber, (match) => {
|
|
1301
|
+
let valid = reParam.test(match)
|
|
1302
|
+
|| match === '__format'
|
|
1303
|
+
|| reString.test(match)
|
|
1304
|
+
|| reNumber.test(match);
|
|
1300
1305
|
if (valid)
|
|
1301
1306
|
return match;
|
|
1302
1307
|
else {
|
|
@@ -12044,7 +12049,7 @@ function deepEqual(o1, o2, options) {
|
|
|
12044
12049
|
if (o1.hasOwnProperty(p)) {
|
|
12045
12050
|
if (options && options.omitKey && options.omitKey[p])
|
|
12046
12051
|
continue;
|
|
12047
|
-
if (o2[p] === undefined)
|
|
12052
|
+
if (o2[p] === undefined && o1[p] !== undefined)
|
|
12048
12053
|
return false;
|
|
12049
12054
|
if (!deepEqual(o1[p], o2[p], options))
|
|
12050
12055
|
return false;
|
|
@@ -12054,7 +12059,7 @@ function deepEqual(o1, o2, options) {
|
|
|
12054
12059
|
if (o2.hasOwnProperty(p)) {
|
|
12055
12060
|
if (options && options.omitKey && options.omitKey[p])
|
|
12056
12061
|
continue;
|
|
12057
|
-
if (o1[p] === undefined)
|
|
12062
|
+
if (o1[p] === undefined && o2[p] !== undefined)
|
|
12058
12063
|
return false;
|
|
12059
12064
|
}
|
|
12060
12065
|
return true;
|