@azrico/webobject 1.4.125 → 1.4.126
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.
|
@@ -62,11 +62,12 @@ export declare class SimpleObject extends MapableObject {
|
|
|
62
62
|
/**
|
|
63
63
|
* calls `setValue` function for all props of `setObj`
|
|
64
64
|
* @param setObj
|
|
65
|
+
* @param changeablesOnly only updates the `__changeables` fields
|
|
65
66
|
* @returns
|
|
66
67
|
*/
|
|
67
68
|
setAll<K extends WriteablePropOf<this>>(setObj: Partial<{
|
|
68
69
|
[key in K]: any;
|
|
69
|
-
}
|
|
70
|
+
}>, changeablesOnly?: boolean): Promise<boolean>;
|
|
70
71
|
/**
|
|
71
72
|
* set value of a key only if the value is empty (null,undef,"")
|
|
72
73
|
* @param key
|
|
@@ -326,38 +326,47 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
326
326
|
/**
|
|
327
327
|
* calls `setValue` function for all props of `setObj`
|
|
328
328
|
* @param setObj
|
|
329
|
+
* @param changeablesOnly only updates the `__changeables` fields
|
|
329
330
|
* @returns
|
|
330
331
|
*/
|
|
331
332
|
}, {
|
|
332
333
|
key: "setAll",
|
|
333
334
|
value: function setAll(_x8) {
|
|
334
335
|
return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(setObj) {
|
|
335
|
-
var
|
|
336
|
+
var changeablesOnly,
|
|
337
|
+
finalRes,
|
|
338
|
+
checkKeys,
|
|
339
|
+
index,
|
|
340
|
+
key,
|
|
341
|
+
_args7 = arguments;
|
|
336
342
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
337
343
|
while (1) switch (_context7.prev = _context7.next) {
|
|
338
344
|
case 0:
|
|
345
|
+
changeablesOnly = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : true;
|
|
339
346
|
finalRes = true;
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
347
|
+
checkKeys = changeablesOnly ? (0, _object.array_intersection)(this.__changeables, Object.keys(setObj)) : Object.keys(setObj);
|
|
348
|
+
index = 0;
|
|
349
|
+
case 4:
|
|
350
|
+
if (!(index < checkKeys.length)) {
|
|
351
|
+
_context7.next = 13;
|
|
344
352
|
break;
|
|
345
353
|
}
|
|
346
|
-
key =
|
|
347
|
-
_context7.next =
|
|
354
|
+
key = checkKeys[index];
|
|
355
|
+
_context7.next = 8;
|
|
348
356
|
return this.setValue(key, setObj[key]);
|
|
349
|
-
case
|
|
357
|
+
case 8:
|
|
350
358
|
if (_context7.sent) {
|
|
351
|
-
_context7.next =
|
|
359
|
+
_context7.next = 10;
|
|
352
360
|
break;
|
|
353
361
|
}
|
|
354
362
|
finalRes = false;
|
|
355
|
-
case 8:
|
|
356
|
-
_context7.next = 2;
|
|
357
|
-
break;
|
|
358
363
|
case 10:
|
|
364
|
+
index++;
|
|
365
|
+
_context7.next = 4;
|
|
366
|
+
break;
|
|
367
|
+
case 13:
|
|
359
368
|
return _context7.abrupt("return", finalRes);
|
|
360
|
-
case
|
|
369
|
+
case 14:
|
|
361
370
|
case "end":
|
|
362
371
|
return _context7.stop();
|
|
363
372
|
}
|