@azrico/webobject 1.4.125 → 1.4.127

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
- }>): Promise<boolean>;
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 finalRes, key;
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
- _context7.t0 = _regeneratorRuntime().keys(setObj);
341
- case 2:
342
- if ((_context7.t1 = _context7.t0()).done) {
343
- _context7.next = 10;
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 = _context7.t1.value;
347
- _context7.next = 6;
354
+ key = checkKeys[index];
355
+ _context7.next = 8;
348
356
  return this.setValue(key, setObj[key]);
349
- case 6:
357
+ case 8:
350
358
  if (_context7.sent) {
351
- _context7.next = 8;
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 11:
369
+ case 14:
361
370
  case "end":
362
371
  return _context7.stop();
363
372
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azrico/webobject",
3
- "version": "1.4.125",
3
+ "version": "1.4.127",
4
4
  "description": "Stateful object",
5
5
  "author": "Azrideus",
6
6
  "license": "MIT",
@@ -75,10 +75,10 @@
75
75
  "@azrico/event": "^1.2.17",
76
76
  "@azrico/global": "^1.3.69",
77
77
  "@azrico/math": "^1.0.5",
78
- "@azrico/object": "^1.4.99",
78
+ "@azrico/object": "^1.4.101",
79
79
  "@azrico/string": "^1.2.91",
80
- "@azrico/types": "^1.0.4",
81
- "@azrico/uid": "^1.0.5"
80
+ "@azrico/types": "^1.0.5",
81
+ "@azrico/uid": "^1.0.7"
82
82
  },
83
83
  "packageManager": "yarn@3.5.0"
84
84
  }