@azrico/webobject 1.4.55 → 1.4.56
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.
|
@@ -206,7 +206,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
206
206
|
value: function () {
|
|
207
207
|
var _get_deltaObject = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(p) {
|
|
208
208
|
var _this2 = this;
|
|
209
|
-
var final_object, isChild, useDelta, allProperties, chkChangables, useExtraProps, dlt, allkeys, changableKeys, functionProps, index, fp,
|
|
209
|
+
var final_object, isChild, useDelta, allProperties, chkChangables, useExtraProps, dlt, allkeys, changableKeys, functionProps, index, fp, formats, simpleProps, _loop, formatname, parseObj, _parseObj, _iterator, _step, key, tempusers;
|
|
210
210
|
return _regeneratorRuntime().wrap(function _callee5$(_context6) {
|
|
211
211
|
while (1) switch (_context6.prev = _context6.next) {
|
|
212
212
|
case 0:
|
|
@@ -305,28 +305,15 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
305
305
|
}
|
|
306
306
|
}
|
|
307
307
|
/* -------------------------------------------------------------------------- */
|
|
308
|
-
/* __simpleProperties */
|
|
309
|
-
/* -------------------------------------------------------------------------- */
|
|
310
|
-
simpleProps = (0, _object.object_getStatic)(this, "__simpleProperties");
|
|
311
|
-
if (Array.isArray(simpleProps)) {
|
|
312
|
-
simpleProps.forEach(function (sp) {
|
|
313
|
-
if (dlt[sp] == null) return;
|
|
314
|
-
var oldValue = dlt[sp];
|
|
315
|
-
var newKey = "simple_" + sp;
|
|
316
|
-
var newValue = typeof oldValue === "string" ? (0, _string.convert_to_simple_string)(oldValue) : undefined;
|
|
317
|
-
dlt[newKey] = newValue;
|
|
318
|
-
//make sure we include this key in delta!
|
|
319
|
-
changableKeys.push(newKey);
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
/* -------------------------------------------------------------------------- */
|
|
323
308
|
/* __formatList */
|
|
324
309
|
/* -------------------------------------------------------------------------- */
|
|
325
310
|
formats = (0, _object.object_getStatic)(this, "__formatList");
|
|
326
311
|
if (!formats) {
|
|
327
|
-
_context6.next =
|
|
312
|
+
_context6.next = 26;
|
|
328
313
|
break;
|
|
329
314
|
}
|
|
315
|
+
simpleProps = (0, _object.wrap_array)(formats.simple);
|
|
316
|
+
delete formats.simple;
|
|
330
317
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop(formatname) {
|
|
331
318
|
var formatKeys;
|
|
332
319
|
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
|
@@ -357,34 +344,49 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
357
344
|
_context6.next = 20;
|
|
358
345
|
break;
|
|
359
346
|
case 25:
|
|
347
|
+
/* -------------------------------------------------------------------------- */
|
|
348
|
+
/* __simpleProperties */
|
|
349
|
+
/* -------------------------------------------------------------------------- */
|
|
350
|
+
if (Array.isArray(simpleProps)) {
|
|
351
|
+
simpleProps.forEach(function (sp) {
|
|
352
|
+
if (dlt[sp] == null) return;
|
|
353
|
+
var oldValue = dlt[sp];
|
|
354
|
+
var newKey = "simple_" + sp;
|
|
355
|
+
var newValue = typeof oldValue === "string" ? (0, _string.convert_to_simple_string)(oldValue) : undefined;
|
|
356
|
+
dlt[newKey] = newValue;
|
|
357
|
+
//make sure we include this key in delta!
|
|
358
|
+
changableKeys.push(newKey);
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
case 26:
|
|
360
362
|
_iterator = _createForOfIteratorHelper(changableKeys);
|
|
361
|
-
_context6.prev =
|
|
363
|
+
_context6.prev = 27;
|
|
362
364
|
_iterator.s();
|
|
363
|
-
case
|
|
365
|
+
case 29:
|
|
364
366
|
if ((_step = _iterator.n()).done) {
|
|
365
|
-
_context6.next =
|
|
367
|
+
_context6.next = 36;
|
|
366
368
|
break;
|
|
367
369
|
}
|
|
368
370
|
key = _step.value;
|
|
369
|
-
_context6.next =
|
|
371
|
+
_context6.next = 33;
|
|
370
372
|
return parseObj(dlt[key]);
|
|
371
|
-
case 32:
|
|
372
|
-
final_object[key] = _context6.sent;
|
|
373
373
|
case 33:
|
|
374
|
-
|
|
374
|
+
final_object[key] = _context6.sent;
|
|
375
|
+
case 34:
|
|
376
|
+
_context6.next = 29;
|
|
375
377
|
break;
|
|
376
|
-
case
|
|
377
|
-
_context6.next =
|
|
378
|
+
case 36:
|
|
379
|
+
_context6.next = 41;
|
|
378
380
|
break;
|
|
379
|
-
case
|
|
380
|
-
_context6.prev =
|
|
381
|
-
_context6.t3 = _context6["catch"](
|
|
381
|
+
case 38:
|
|
382
|
+
_context6.prev = 38;
|
|
383
|
+
_context6.t3 = _context6["catch"](27);
|
|
382
384
|
_iterator.e(_context6.t3);
|
|
383
|
-
case
|
|
384
|
-
_context6.prev =
|
|
385
|
+
case 41:
|
|
386
|
+
_context6.prev = 41;
|
|
385
387
|
_iterator.f();
|
|
386
|
-
return _context6.finish(
|
|
387
|
-
case
|
|
388
|
+
return _context6.finish(41);
|
|
389
|
+
case 44:
|
|
388
390
|
/* -------------------------------------------------------------------------- */
|
|
389
391
|
/* add id properties */
|
|
390
392
|
/* -------------------------------------------------------------------------- */
|
|
@@ -405,11 +407,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
405
407
|
final_object["_users"] = (0, _object.wrap_array)(tempusers);
|
|
406
408
|
}
|
|
407
409
|
return _context6.abrupt("return", final_object);
|
|
408
|
-
case
|
|
410
|
+
case 47:
|
|
409
411
|
case "end":
|
|
410
412
|
return _context6.stop();
|
|
411
413
|
}
|
|
412
|
-
}, _callee5, this, [[
|
|
414
|
+
}, _callee5, this, [[27, 38, 41, 44]]);
|
|
413
415
|
}));
|
|
414
416
|
function get_deltaObject(_x) {
|
|
415
417
|
return _get_deltaObject.apply(this, arguments);
|
|
@@ -14,7 +14,6 @@ export declare class SimpleObject extends MapableObject {
|
|
|
14
14
|
static readonly __changeables?: string[];
|
|
15
15
|
static readonly __protectedProperties?: string[];
|
|
16
16
|
static readonly __functionProperties?: string[];
|
|
17
|
-
static readonly __simpleProperties?: string[];
|
|
18
17
|
static readonly __formatList?: {
|
|
19
18
|
[Property in strAction]?: string[];
|
|
20
19
|
};
|
|
@@ -1175,8 +1175,6 @@ _defineProperty(SimpleObject, "__changeables", void 0);
|
|
|
1175
1175
|
_defineProperty(SimpleObject, "__protectedProperties", void 0);
|
|
1176
1176
|
//these properties will be evaluated when needed
|
|
1177
1177
|
_defineProperty(SimpleObject, "__functionProperties", void 0);
|
|
1178
|
-
//a lowercase copy of these properties will be saved
|
|
1179
|
-
_defineProperty(SimpleObject, "__simpleProperties", void 0);
|
|
1180
1178
|
//apply these string formats
|
|
1181
1179
|
_defineProperty(SimpleObject, "__formatList", void 0);
|
|
1182
1180
|
//these properties usually are not directly changed and sometimes are included in deltaObject
|