@azrico/webobject 1.4.55 → 1.4.57
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, use_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,34 +305,22 @@ 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 = 27;
|
|
328
313
|
break;
|
|
329
314
|
}
|
|
315
|
+
use_formats = _objectSpread({}, formats);
|
|
316
|
+
simpleProps = (0, _object.wrap_array)(use_formats.simple);
|
|
317
|
+
delete use_formats.simple;
|
|
330
318
|
_loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop(formatname) {
|
|
331
319
|
var formatKeys;
|
|
332
320
|
return _regeneratorRuntime().wrap(function _loop$(_context3) {
|
|
333
321
|
while (1) switch (_context3.prev = _context3.next) {
|
|
334
322
|
case 0:
|
|
335
|
-
formatKeys =
|
|
323
|
+
formatKeys = use_formats[formatname];
|
|
336
324
|
if (Array.isArray(formatKeys)) {
|
|
337
325
|
formatKeys.forEach(function (fk) {
|
|
338
326
|
if (typeof dlt[fk] !== "string") return;
|
|
@@ -345,46 +333,61 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
345
333
|
}
|
|
346
334
|
}, _loop);
|
|
347
335
|
});
|
|
348
|
-
_context6.t0 = _regeneratorRuntime().keys(
|
|
349
|
-
case
|
|
336
|
+
_context6.t0 = _regeneratorRuntime().keys(use_formats);
|
|
337
|
+
case 21:
|
|
350
338
|
if ((_context6.t1 = _context6.t0()).done) {
|
|
351
|
-
_context6.next =
|
|
339
|
+
_context6.next = 26;
|
|
352
340
|
break;
|
|
353
341
|
}
|
|
354
342
|
formatname = _context6.t1.value;
|
|
355
|
-
return _context6.delegateYield(_loop(formatname), "t2",
|
|
356
|
-
case
|
|
357
|
-
_context6.next =
|
|
343
|
+
return _context6.delegateYield(_loop(formatname), "t2", 24);
|
|
344
|
+
case 24:
|
|
345
|
+
_context6.next = 21;
|
|
358
346
|
break;
|
|
359
|
-
case
|
|
347
|
+
case 26:
|
|
348
|
+
/* -------------------------------------------------------------------------- */
|
|
349
|
+
/* __simpleProperties */
|
|
350
|
+
/* -------------------------------------------------------------------------- */
|
|
351
|
+
if (Array.isArray(simpleProps)) {
|
|
352
|
+
simpleProps.forEach(function (sp) {
|
|
353
|
+
if (dlt[sp] == null) return;
|
|
354
|
+
var oldValue = dlt[sp];
|
|
355
|
+
var newKey = "simple_" + sp;
|
|
356
|
+
var newValue = typeof oldValue === "string" ? (0, _string.convert_to_simple_string)(oldValue) : undefined;
|
|
357
|
+
dlt[newKey] = newValue;
|
|
358
|
+
//make sure we include this key in delta!
|
|
359
|
+
changableKeys.push(newKey);
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
case 27:
|
|
360
363
|
_iterator = _createForOfIteratorHelper(changableKeys);
|
|
361
|
-
_context6.prev =
|
|
364
|
+
_context6.prev = 28;
|
|
362
365
|
_iterator.s();
|
|
363
|
-
case
|
|
366
|
+
case 30:
|
|
364
367
|
if ((_step = _iterator.n()).done) {
|
|
365
|
-
_context6.next =
|
|
368
|
+
_context6.next = 37;
|
|
366
369
|
break;
|
|
367
370
|
}
|
|
368
371
|
key = _step.value;
|
|
369
|
-
_context6.next =
|
|
372
|
+
_context6.next = 34;
|
|
370
373
|
return parseObj(dlt[key]);
|
|
371
|
-
case
|
|
374
|
+
case 34:
|
|
372
375
|
final_object[key] = _context6.sent;
|
|
373
|
-
case 33:
|
|
374
|
-
_context6.next = 28;
|
|
375
|
-
break;
|
|
376
376
|
case 35:
|
|
377
|
-
_context6.next =
|
|
377
|
+
_context6.next = 30;
|
|
378
378
|
break;
|
|
379
379
|
case 37:
|
|
380
|
-
_context6.
|
|
381
|
-
|
|
380
|
+
_context6.next = 42;
|
|
381
|
+
break;
|
|
382
|
+
case 39:
|
|
383
|
+
_context6.prev = 39;
|
|
384
|
+
_context6.t3 = _context6["catch"](28);
|
|
382
385
|
_iterator.e(_context6.t3);
|
|
383
|
-
case
|
|
384
|
-
_context6.prev =
|
|
386
|
+
case 42:
|
|
387
|
+
_context6.prev = 42;
|
|
385
388
|
_iterator.f();
|
|
386
|
-
return _context6.finish(
|
|
387
|
-
case
|
|
389
|
+
return _context6.finish(42);
|
|
390
|
+
case 45:
|
|
388
391
|
/* -------------------------------------------------------------------------- */
|
|
389
392
|
/* add id properties */
|
|
390
393
|
/* -------------------------------------------------------------------------- */
|
|
@@ -405,11 +408,11 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
405
408
|
final_object["_users"] = (0, _object.wrap_array)(tempusers);
|
|
406
409
|
}
|
|
407
410
|
return _context6.abrupt("return", final_object);
|
|
408
|
-
case
|
|
411
|
+
case 48:
|
|
409
412
|
case "end":
|
|
410
413
|
return _context6.stop();
|
|
411
414
|
}
|
|
412
|
-
}, _callee5, this, [[
|
|
415
|
+
}, _callee5, this, [[28, 39, 42, 45]]);
|
|
413
416
|
}));
|
|
414
417
|
function get_deltaObject(_x) {
|
|
415
418
|
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
|