@azrico/webobject 1.4.119 → 1.4.122
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.
|
@@ -56,7 +56,8 @@ export declare class SimpleObject extends MapableObject {
|
|
|
56
56
|
set: (key: WriteablePropOf<this>, value: any, sendChanges?: sendChangesType) => Promise<boolean>;
|
|
57
57
|
setTemp(key: string, value: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
58
58
|
clearRefreshFunction(): Promise<void>;
|
|
59
|
-
|
|
59
|
+
setRefreshFunction(new_fnc: any): Promise<any>;
|
|
60
|
+
addRefreshFunction(new_fnc: any): any;
|
|
60
61
|
runRefreshFunction(...params: any): Promise<void>;
|
|
61
62
|
setAll<K extends WriteablePropOf<this>>(setObj: {
|
|
62
63
|
[key in K]: any;
|
|
@@ -85,13 +86,21 @@ export declare class SimpleObject extends MapableObject {
|
|
|
85
86
|
setSubValue<MKey extends PropOf<this>>(key: MKey, objKey: string, subvalue: any, sendChanges?: sendChangesType): Promise<boolean>;
|
|
86
87
|
getSubValue: (key: PropOf<this>, subkey: string, original?: boolean) => any;
|
|
87
88
|
/**
|
|
88
|
-
* Push value
|
|
89
|
+
* Push a single value to array property
|
|
89
90
|
* @param key
|
|
90
91
|
* @param value
|
|
91
92
|
* @param sendChanges
|
|
92
93
|
* @returns
|
|
93
94
|
*/
|
|
94
95
|
pushValue<MKey extends PropOf<this>>(key: MKey, value: any, sendChanges?: sendChangesType): Promise<this[MKey] | false>;
|
|
96
|
+
/**
|
|
97
|
+
* Push a list of values to array property
|
|
98
|
+
* @param key
|
|
99
|
+
* @param values
|
|
100
|
+
* @param sendChanges
|
|
101
|
+
* @returns
|
|
102
|
+
*/
|
|
103
|
+
pushValues<MKey extends PropOf<this>>(key: MKey, values: any[], sendChanges?: sendChangesType): Promise<this[MKey] | false>;
|
|
95
104
|
notifyChanged<MKey extends PropOf<this>>(type: string, key: MKey | string, value: any, subvalue?: any): Promise<void>;
|
|
96
105
|
/**
|
|
97
106
|
* check if a key can be changed on an object
|
|
@@ -12,12 +12,6 @@ var _ObjectManager = _interopRequireDefault(require("./ObjectManager"));
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
14
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
15
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
16
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
17
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
19
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
20
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
21
15
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
22
16
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
23
17
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
@@ -46,7 +40,7 @@ var _setProperty = /*#__PURE__*/new WeakSet();
|
|
|
46
40
|
var _setDefaultProperty = /*#__PURE__*/new WeakSet();
|
|
47
41
|
var _getProperty = /*#__PURE__*/new WeakSet();
|
|
48
42
|
var _setSaveResultObject = /*#__PURE__*/new WeakSet();
|
|
49
|
-
var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _clearRefreshFunction, _addRefreshFunction, _runRefreshFunction, _setAll, _setSubValue, _pushValue, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
|
|
43
|
+
var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _clearRefreshFunction, _setRefreshFunction, _addRefreshFunction, _runRefreshFunction, _setAll, _setSubValue, _pushValue, _pushValues, _notifyChanged, _reset, _resetAll, _event_run, _event_add, _setTemp2, _delete_cache) {
|
|
50
44
|
_inherits(SimpleObject, _MapableObject);
|
|
51
45
|
var _super = _createSuper(SimpleObject);
|
|
52
46
|
function SimpleObject() {
|
|
@@ -223,7 +217,7 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
223
217
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
224
218
|
while (1) switch (_context3.prev = _context3.next) {
|
|
225
219
|
case 0:
|
|
226
|
-
this.__refresh_functions =
|
|
220
|
+
this.__refresh_functions = undefined;
|
|
227
221
|
case 1:
|
|
228
222
|
case "end":
|
|
229
223
|
return _context3.stop();
|
|
@@ -232,28 +226,51 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
232
226
|
}))).apply(this, arguments);
|
|
233
227
|
}
|
|
234
228
|
}, {
|
|
235
|
-
key: "
|
|
236
|
-
value: function
|
|
237
|
-
return (
|
|
238
|
-
var oldFunctions;
|
|
229
|
+
key: "setRefreshFunction",
|
|
230
|
+
value: function setRefreshFunction(_x5) {
|
|
231
|
+
return (_setRefreshFunction = _setRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(new_fnc) {
|
|
239
232
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
240
233
|
while (1) switch (_context4.prev = _context4.next) {
|
|
241
234
|
case 0:
|
|
235
|
+
_context4.next = 2;
|
|
236
|
+
return this.addRefreshFunction(new_fnc);
|
|
237
|
+
case 2:
|
|
238
|
+
return _context4.abrupt("return", _context4.sent);
|
|
239
|
+
case 3:
|
|
240
|
+
case "end":
|
|
241
|
+
return _context4.stop();
|
|
242
|
+
}
|
|
243
|
+
}, _callee4, this);
|
|
244
|
+
}))).apply(this, arguments);
|
|
245
|
+
}
|
|
246
|
+
}, {
|
|
247
|
+
key: "addRefreshFunction",
|
|
248
|
+
value: function addRefreshFunction(_x6, _x7) {
|
|
249
|
+
return (_addRefreshFunction = _addRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(key, new_fnc) {
|
|
250
|
+
var oldFunctions;
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
252
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
253
|
+
case 0:
|
|
254
|
+
if (typeof key === "function") {
|
|
255
|
+
new_fnc = key;
|
|
256
|
+
key = "main";
|
|
257
|
+
}
|
|
258
|
+
key = key || "main";
|
|
242
259
|
oldFunctions = this.__refresh_functions;
|
|
243
260
|
if (oldFunctions == null || _typeof(oldFunctions) !== "object") oldFunctions = {};
|
|
244
261
|
oldFunctions[key] = new_fnc;
|
|
245
262
|
this.__refresh_functions = oldFunctions;
|
|
246
|
-
case
|
|
263
|
+
case 6:
|
|
247
264
|
case "end":
|
|
248
|
-
return
|
|
265
|
+
return _context5.stop();
|
|
249
266
|
}
|
|
250
|
-
},
|
|
267
|
+
}, _callee5, this);
|
|
251
268
|
}))).apply(this, arguments);
|
|
252
269
|
}
|
|
253
270
|
}, {
|
|
254
271
|
key: "runRefreshFunction",
|
|
255
272
|
value: function runRefreshFunction() {
|
|
256
|
-
return (_runRefreshFunction = _runRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
273
|
+
return (_runRefreshFunction = _runRefreshFunction || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
257
274
|
var oldFunctions,
|
|
258
275
|
fncArray,
|
|
259
276
|
_len,
|
|
@@ -261,70 +278,75 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
261
278
|
_key,
|
|
262
279
|
index,
|
|
263
280
|
fnc,
|
|
264
|
-
|
|
265
|
-
return _regeneratorRuntime().wrap(function
|
|
266
|
-
while (1) switch (
|
|
281
|
+
_args6 = arguments;
|
|
282
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
283
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
267
284
|
case 0:
|
|
268
285
|
oldFunctions = this.__refresh_functions;
|
|
269
|
-
if (oldFunctions == null || _typeof(oldFunctions) !== "object")
|
|
286
|
+
if (!(oldFunctions == null || _typeof(oldFunctions) !== "object")) {
|
|
287
|
+
_context6.next = 3;
|
|
288
|
+
break;
|
|
289
|
+
}
|
|
290
|
+
return _context6.abrupt("return");
|
|
291
|
+
case 3:
|
|
270
292
|
fncArray = Object.values(oldFunctions);
|
|
271
|
-
for (_len =
|
|
272
|
-
params[_key] =
|
|
293
|
+
for (_len = _args6.length, params = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
294
|
+
params[_key] = _args6[_key];
|
|
273
295
|
}
|
|
274
296
|
index = 0;
|
|
275
|
-
case
|
|
297
|
+
case 6:
|
|
276
298
|
if (!(index < fncArray.length)) {
|
|
277
|
-
|
|
299
|
+
_context6.next = 13;
|
|
278
300
|
break;
|
|
279
301
|
}
|
|
280
302
|
fnc = fncArray[index];
|
|
281
|
-
|
|
303
|
+
_context6.next = 10;
|
|
282
304
|
return _object.fn_eval.apply(void 0, [fnc].concat(params));
|
|
283
|
-
case
|
|
305
|
+
case 10:
|
|
284
306
|
index++;
|
|
285
|
-
|
|
307
|
+
_context6.next = 6;
|
|
286
308
|
break;
|
|
287
|
-
case
|
|
309
|
+
case 13:
|
|
288
310
|
case "end":
|
|
289
|
-
return
|
|
311
|
+
return _context6.stop();
|
|
290
312
|
}
|
|
291
|
-
},
|
|
313
|
+
}, _callee6, this);
|
|
292
314
|
}))).apply(this, arguments);
|
|
293
315
|
} /* -------------------------------------------------------------------------- */
|
|
294
316
|
}, {
|
|
295
317
|
key: "setAll",
|
|
296
|
-
value: function setAll(
|
|
297
|
-
return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
318
|
+
value: function setAll(_x8) {
|
|
319
|
+
return (_setAll = _setAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(setObj) {
|
|
298
320
|
var finalRes, key;
|
|
299
|
-
return _regeneratorRuntime().wrap(function
|
|
300
|
-
while (1) switch (
|
|
321
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
322
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
301
323
|
case 0:
|
|
302
324
|
finalRes = true;
|
|
303
|
-
|
|
325
|
+
_context7.t0 = _regeneratorRuntime().keys(setObj);
|
|
304
326
|
case 2:
|
|
305
|
-
if ((
|
|
306
|
-
|
|
327
|
+
if ((_context7.t1 = _context7.t0()).done) {
|
|
328
|
+
_context7.next = 10;
|
|
307
329
|
break;
|
|
308
330
|
}
|
|
309
|
-
key =
|
|
310
|
-
|
|
331
|
+
key = _context7.t1.value;
|
|
332
|
+
_context7.next = 6;
|
|
311
333
|
return this.setValue(key, setObj[key]);
|
|
312
334
|
case 6:
|
|
313
|
-
if (
|
|
314
|
-
|
|
335
|
+
if (_context7.sent) {
|
|
336
|
+
_context7.next = 8;
|
|
315
337
|
break;
|
|
316
338
|
}
|
|
317
339
|
finalRes = false;
|
|
318
340
|
case 8:
|
|
319
|
-
|
|
341
|
+
_context7.next = 2;
|
|
320
342
|
break;
|
|
321
343
|
case 10:
|
|
322
|
-
return
|
|
344
|
+
return _context7.abrupt("return", finalRes);
|
|
323
345
|
case 11:
|
|
324
346
|
case "end":
|
|
325
|
-
return
|
|
347
|
+
return _context7.stop();
|
|
326
348
|
}
|
|
327
|
-
},
|
|
349
|
+
}, _callee7, this);
|
|
328
350
|
}))).apply(this, arguments);
|
|
329
351
|
}
|
|
330
352
|
/**
|
|
@@ -348,30 +370,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
348
370
|
* @param subvalue
|
|
349
371
|
* @return true if changed , false otherwise
|
|
350
372
|
*/
|
|
351
|
-
function setSubValue(
|
|
352
|
-
return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
373
|
+
function setSubValue(_x9, _x10, _x11) {
|
|
374
|
+
return (_setSubValue = _setSubValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(key, objKey, subvalue) {
|
|
353
375
|
var sendChanges,
|
|
354
376
|
isValueChanged,
|
|
355
377
|
subval,
|
|
356
|
-
|
|
357
|
-
return _regeneratorRuntime().wrap(function
|
|
358
|
-
while (1) switch (
|
|
378
|
+
_args8 = arguments;
|
|
379
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
380
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
359
381
|
case 0:
|
|
360
|
-
sendChanges =
|
|
382
|
+
sendChanges = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : "auto";
|
|
361
383
|
if (this.canModify) {
|
|
362
|
-
|
|
384
|
+
_context8.next = 7;
|
|
363
385
|
break;
|
|
364
386
|
}
|
|
365
387
|
if (!(this.__throw_errors !== false)) {
|
|
366
|
-
|
|
388
|
+
_context8.next = 6;
|
|
367
389
|
break;
|
|
368
390
|
}
|
|
369
391
|
throw Error("Cant use setValue when on readonly mode");
|
|
370
392
|
case 6:
|
|
371
|
-
return
|
|
393
|
+
return _context8.abrupt("return", false);
|
|
372
394
|
case 7:
|
|
373
395
|
isValueChanged = false;
|
|
374
|
-
|
|
396
|
+
_context8.prev = 8;
|
|
375
397
|
//if accessing subval of an object, make sure the object is not null
|
|
376
398
|
subval = _classPrivateMethodGet(this, _getSubProperty, _getSubProperty2).call(this, key, objKey);
|
|
377
399
|
if (!(0, _object.object_equals)(subval, subvalue, {
|
|
@@ -382,100 +404,126 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
382
404
|
isValueChanged = true;
|
|
383
405
|
} else isValueChanged = false;
|
|
384
406
|
case 11:
|
|
385
|
-
|
|
407
|
+
_context8.prev = 11;
|
|
386
408
|
if (!(sendChanges === true || sendChanges === "auto" && isValueChanged)) {
|
|
387
|
-
|
|
409
|
+
_context8.next = 15;
|
|
388
410
|
break;
|
|
389
411
|
}
|
|
390
|
-
|
|
412
|
+
_context8.next = 15;
|
|
391
413
|
return this.notifyChanged("", key, objKey, subvalue);
|
|
392
414
|
case 15:
|
|
393
|
-
return
|
|
415
|
+
return _context8.finish(11);
|
|
394
416
|
case 16:
|
|
395
|
-
return
|
|
417
|
+
return _context8.abrupt("return", isValueChanged);
|
|
396
418
|
case 17:
|
|
397
419
|
case "end":
|
|
398
|
-
return
|
|
420
|
+
return _context8.stop();
|
|
399
421
|
}
|
|
400
|
-
},
|
|
422
|
+
}, _callee8, this, [[8,, 11, 16]]);
|
|
401
423
|
}))).apply(this, arguments);
|
|
402
424
|
}
|
|
403
425
|
}, {
|
|
404
426
|
key: "pushValue",
|
|
405
427
|
value:
|
|
406
428
|
/**
|
|
407
|
-
* Push value
|
|
429
|
+
* Push a single value to array property
|
|
408
430
|
* @param key
|
|
409
431
|
* @param value
|
|
410
432
|
* @param sendChanges
|
|
411
433
|
* @returns
|
|
412
434
|
*/
|
|
413
|
-
function pushValue(
|
|
414
|
-
return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
435
|
+
function pushValue(_x12, _x13) {
|
|
436
|
+
return (_pushValue = _pushValue || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(key, value) {
|
|
437
|
+
var sendChanges,
|
|
438
|
+
_args9 = arguments;
|
|
439
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
440
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
441
|
+
case 0:
|
|
442
|
+
sendChanges = _args9.length > 2 && _args9[2] !== undefined ? _args9[2] : "auto";
|
|
443
|
+
_context9.next = 3;
|
|
444
|
+
return this.pushValue(key, [value], sendChanges);
|
|
445
|
+
case 3:
|
|
446
|
+
return _context9.abrupt("return", _context9.sent);
|
|
447
|
+
case 4:
|
|
448
|
+
case "end":
|
|
449
|
+
return _context9.stop();
|
|
450
|
+
}
|
|
451
|
+
}, _callee9, this);
|
|
452
|
+
}))).apply(this, arguments);
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Push a list of values to array property
|
|
456
|
+
* @param key
|
|
457
|
+
* @param values
|
|
458
|
+
* @param sendChanges
|
|
459
|
+
* @returns
|
|
460
|
+
*/
|
|
461
|
+
}, {
|
|
462
|
+
key: "pushValues",
|
|
463
|
+
value: function pushValues(_x14, _x15) {
|
|
464
|
+
return (_pushValues = _pushValues || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(key, values) {
|
|
415
465
|
var sendChanges,
|
|
416
466
|
tempArray,
|
|
417
|
-
|
|
418
|
-
return _regeneratorRuntime().wrap(function
|
|
419
|
-
while (1) switch (
|
|
467
|
+
_args10 = arguments;
|
|
468
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
469
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
420
470
|
case 0:
|
|
421
|
-
sendChanges =
|
|
422
|
-
if (!(
|
|
423
|
-
|
|
471
|
+
sendChanges = _args10.length > 2 && _args10[2] !== undefined ? _args10[2] : "auto";
|
|
472
|
+
if (!(0, _object.array_isEmpty)(values)) {
|
|
473
|
+
_context10.next = 3;
|
|
424
474
|
break;
|
|
425
475
|
}
|
|
426
|
-
return
|
|
476
|
+
return _context10.abrupt("return", false);
|
|
427
477
|
case 3:
|
|
428
478
|
if (this.canModify) {
|
|
429
|
-
|
|
479
|
+
_context10.next = 9;
|
|
430
480
|
break;
|
|
431
481
|
}
|
|
432
482
|
if (!(this.__throw_errors !== false)) {
|
|
433
|
-
|
|
483
|
+
_context10.next = 8;
|
|
434
484
|
break;
|
|
435
485
|
}
|
|
436
|
-
throw Error("Cant use
|
|
486
|
+
throw Error("Cant use pushValues when on readonly mode");
|
|
437
487
|
case 8:
|
|
438
|
-
return
|
|
488
|
+
return _context10.abrupt("return", false);
|
|
439
489
|
case 9:
|
|
440
|
-
if (_classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key) == null)
|
|
441
|
-
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, []);
|
|
442
|
-
}
|
|
490
|
+
if (_classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key) == null) _classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, []);
|
|
443
491
|
tempArray = _classPrivateMethodGet(this, _getProperty, _getProperty2).call(this, key);
|
|
444
492
|
if (Array.isArray(tempArray)) {
|
|
445
|
-
|
|
493
|
+
_context10.next = 17;
|
|
446
494
|
break;
|
|
447
495
|
}
|
|
448
496
|
if (!(this.__throw_errors !== false)) {
|
|
449
|
-
|
|
497
|
+
_context10.next = 16;
|
|
450
498
|
break;
|
|
451
499
|
}
|
|
452
|
-
throw Error("Cant use
|
|
500
|
+
throw Error("Cant use pushValues on non Array keys");
|
|
453
501
|
case 16:
|
|
454
|
-
return
|
|
502
|
+
return _context10.abrupt("return", false);
|
|
455
503
|
case 17:
|
|
456
|
-
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key,
|
|
504
|
+
_classPrivateMethodGet(this, _setProperty, _setProperty2).call(this, key, (0, _object.array_merge)(tempArray, values));
|
|
457
505
|
if (!(sendChanges === true || sendChanges === "auto")) {
|
|
458
|
-
|
|
506
|
+
_context10.next = 21;
|
|
459
507
|
break;
|
|
460
508
|
}
|
|
461
|
-
|
|
462
|
-
return this.notifyChanged("", key,
|
|
509
|
+
_context10.next = 21;
|
|
510
|
+
return this.notifyChanged("", key, values);
|
|
463
511
|
case 21:
|
|
464
|
-
return
|
|
512
|
+
return _context10.abrupt("return", tempArray);
|
|
465
513
|
case 22:
|
|
466
514
|
case "end":
|
|
467
|
-
return
|
|
515
|
+
return _context10.stop();
|
|
468
516
|
}
|
|
469
|
-
},
|
|
517
|
+
}, _callee10, this);
|
|
470
518
|
}))).apply(this, arguments);
|
|
471
519
|
}
|
|
472
520
|
}, {
|
|
473
521
|
key: "notifyChanged",
|
|
474
|
-
value: function notifyChanged(
|
|
475
|
-
return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
522
|
+
value: function notifyChanged(_x16, _x17, _x18, _x19) {
|
|
523
|
+
return (_notifyChanged = _notifyChanged || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(type, key, value, subvalue) {
|
|
476
524
|
var lc, manager_class;
|
|
477
|
-
return _regeneratorRuntime().wrap(function
|
|
478
|
-
while (1) switch (
|
|
525
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
526
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
479
527
|
case 0:
|
|
480
528
|
if (value === undefined && type == "") value = this.getValue(key);
|
|
481
529
|
this.__changed = true;
|
|
@@ -490,16 +538,16 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
490
538
|
/* --------------------------- notify the manager --------------------------- */
|
|
491
539
|
manager_class = this.manager;
|
|
492
540
|
if (!(manager_class instanceof _ObjectManager["default"])) {
|
|
493
|
-
|
|
541
|
+
_context11.next = 10;
|
|
494
542
|
break;
|
|
495
543
|
}
|
|
496
|
-
|
|
544
|
+
_context11.next = 10;
|
|
497
545
|
return manager_class.notifyChanged(type, key, value, subvalue);
|
|
498
546
|
case 10:
|
|
499
547
|
case "end":
|
|
500
|
-
return
|
|
548
|
+
return _context11.stop();
|
|
501
549
|
}
|
|
502
|
-
},
|
|
550
|
+
}, _callee11, this);
|
|
503
551
|
}))).apply(this, arguments);
|
|
504
552
|
}
|
|
505
553
|
/**
|
|
@@ -563,23 +611,23 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
563
611
|
*/
|
|
564
612
|
}, {
|
|
565
613
|
key: "reset",
|
|
566
|
-
value: function reset(
|
|
567
|
-
return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
614
|
+
value: function reset(_x20) {
|
|
615
|
+
return (_reset = _reset || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(key) {
|
|
568
616
|
var notifyChanged,
|
|
569
|
-
|
|
570
|
-
return _regeneratorRuntime().wrap(function
|
|
571
|
-
while (1) switch (
|
|
617
|
+
_args12 = arguments;
|
|
618
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
619
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
572
620
|
case 0:
|
|
573
|
-
notifyChanged =
|
|
574
|
-
|
|
621
|
+
notifyChanged = _args12.length > 1 && _args12[1] !== undefined ? _args12[1] : "auto";
|
|
622
|
+
_context12.next = 3;
|
|
575
623
|
return this.setValue(key, this[key], notifyChanged);
|
|
576
624
|
case 3:
|
|
577
|
-
return
|
|
625
|
+
return _context12.abrupt("return", _context12.sent);
|
|
578
626
|
case 4:
|
|
579
627
|
case "end":
|
|
580
|
-
return
|
|
628
|
+
return _context12.stop();
|
|
581
629
|
}
|
|
582
|
-
},
|
|
630
|
+
}, _callee12, this);
|
|
583
631
|
}))).apply(this, arguments);
|
|
584
632
|
}
|
|
585
633
|
/**
|
|
@@ -590,43 +638,43 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
590
638
|
}, {
|
|
591
639
|
key: "resetAll",
|
|
592
640
|
value: function resetAll() {
|
|
593
|
-
return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
641
|
+
return (_resetAll = _resetAll || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13() {
|
|
594
642
|
var notifyChanged,
|
|
595
643
|
fr,
|
|
596
644
|
key,
|
|
597
|
-
|
|
598
|
-
return _regeneratorRuntime().wrap(function
|
|
599
|
-
while (1) switch (
|
|
645
|
+
_args13 = arguments;
|
|
646
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
647
|
+
while (1) switch (_context13.prev = _context13.next) {
|
|
600
648
|
case 0:
|
|
601
|
-
notifyChanged =
|
|
649
|
+
notifyChanged = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : "auto";
|
|
602
650
|
fr = true;
|
|
603
|
-
|
|
651
|
+
_context13.t0 = _regeneratorRuntime().keys(this.__delta);
|
|
604
652
|
case 3:
|
|
605
|
-
if ((
|
|
606
|
-
|
|
653
|
+
if ((_context13.t1 = _context13.t0()).done) {
|
|
654
|
+
_context13.next = 13;
|
|
607
655
|
break;
|
|
608
656
|
}
|
|
609
|
-
key =
|
|
610
|
-
|
|
611
|
-
if (!
|
|
612
|
-
|
|
657
|
+
key = _context13.t1.value;
|
|
658
|
+
_context13.t2 = fr;
|
|
659
|
+
if (!_context13.t2) {
|
|
660
|
+
_context13.next = 10;
|
|
613
661
|
break;
|
|
614
662
|
}
|
|
615
|
-
|
|
663
|
+
_context13.next = 9;
|
|
616
664
|
return this.reset(key, notifyChanged);
|
|
617
665
|
case 9:
|
|
618
|
-
|
|
666
|
+
_context13.t2 = _context13.sent;
|
|
619
667
|
case 10:
|
|
620
|
-
fr =
|
|
621
|
-
|
|
668
|
+
fr = _context13.t2;
|
|
669
|
+
_context13.next = 3;
|
|
622
670
|
break;
|
|
623
671
|
case 13:
|
|
624
|
-
return
|
|
672
|
+
return _context13.abrupt("return", fr);
|
|
625
673
|
case 14:
|
|
626
674
|
case "end":
|
|
627
|
-
return
|
|
675
|
+
return _context13.stop();
|
|
628
676
|
}
|
|
629
|
-
},
|
|
677
|
+
}, _callee13, this);
|
|
630
678
|
}))).apply(this, arguments);
|
|
631
679
|
}
|
|
632
680
|
/**
|
|
@@ -798,35 +846,35 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
798
846
|
/* -------------------------------------------------------------------------- */
|
|
799
847
|
/* Events */
|
|
800
848
|
/* -------------------------------------------------------------------------- */
|
|
801
|
-
function event_run(
|
|
802
|
-
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
849
|
+
function event_run(_x21) {
|
|
850
|
+
return (_event_run = _event_run || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(eventName) {
|
|
803
851
|
var _this$manager;
|
|
804
852
|
var _len2,
|
|
805
853
|
params,
|
|
806
854
|
_key2,
|
|
807
|
-
|
|
808
|
-
return _regeneratorRuntime().wrap(function
|
|
809
|
-
while (1) switch (
|
|
855
|
+
_args14 = arguments;
|
|
856
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
857
|
+
while (1) switch (_context14.prev = _context14.next) {
|
|
810
858
|
case 0:
|
|
811
859
|
if (this.manager) {
|
|
812
|
-
|
|
860
|
+
_context14.next = 3;
|
|
813
861
|
break;
|
|
814
862
|
}
|
|
815
863
|
if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
|
|
816
|
-
return
|
|
864
|
+
return _context14.abrupt("return");
|
|
817
865
|
case 3:
|
|
818
|
-
for (_len2 =
|
|
819
|
-
params[_key2 - 1] =
|
|
866
|
+
for (_len2 = _args14.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
867
|
+
params[_key2 - 1] = _args14[_key2];
|
|
820
868
|
}
|
|
821
|
-
|
|
869
|
+
_context14.next = 6;
|
|
822
870
|
return (_this$manager = this.manager).event_run.apply(_this$manager, [eventName].concat(params));
|
|
823
871
|
case 6:
|
|
824
|
-
return
|
|
872
|
+
return _context14.abrupt("return", _context14.sent);
|
|
825
873
|
case 7:
|
|
826
874
|
case "end":
|
|
827
|
-
return
|
|
875
|
+
return _context14.stop();
|
|
828
876
|
}
|
|
829
|
-
},
|
|
877
|
+
}, _callee14, this);
|
|
830
878
|
}))).apply(this, arguments);
|
|
831
879
|
}
|
|
832
880
|
}, {
|
|
@@ -851,30 +899,30 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
851
899
|
}
|
|
852
900
|
}, {
|
|
853
901
|
key: "event_add",
|
|
854
|
-
value: function event_add(
|
|
855
|
-
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
902
|
+
value: function event_add(_x22, _x23, _x24) {
|
|
903
|
+
return (_event_add = _event_add || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15(name, uname, runEvent) {
|
|
856
904
|
var onlyOn,
|
|
857
905
|
runOnce,
|
|
858
|
-
|
|
859
|
-
return _regeneratorRuntime().wrap(function
|
|
860
|
-
while (1) switch (
|
|
906
|
+
_args15 = arguments;
|
|
907
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
908
|
+
while (1) switch (_context15.prev = _context15.next) {
|
|
861
909
|
case 0:
|
|
862
|
-
onlyOn =
|
|
863
|
-
runOnce =
|
|
910
|
+
onlyOn = _args15.length > 3 && _args15[3] !== undefined ? _args15[3] : null;
|
|
911
|
+
runOnce = _args15.length > 4 && _args15[4] !== undefined ? _args15[4] : false;
|
|
864
912
|
if (this.manager) {
|
|
865
|
-
|
|
913
|
+
_context15.next = 5;
|
|
866
914
|
break;
|
|
867
915
|
}
|
|
868
916
|
if (this.__showErrors === true) console.error("you cant use events if your object has no manager");
|
|
869
|
-
return
|
|
917
|
+
return _context15.abrupt("return");
|
|
870
918
|
case 5:
|
|
871
|
-
|
|
919
|
+
_context15.next = 7;
|
|
872
920
|
return this.manager.event_add(name, uname, runEvent, onlyOn, runOnce);
|
|
873
921
|
case 7:
|
|
874
922
|
case "end":
|
|
875
|
-
return
|
|
923
|
+
return _context15.stop();
|
|
876
924
|
}
|
|
877
|
-
},
|
|
925
|
+
}, _callee15, this);
|
|
878
926
|
}))).apply(this, arguments);
|
|
879
927
|
}
|
|
880
928
|
/* -------------------------------------------------------------------------- */
|
|
@@ -1214,37 +1262,37 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
1214
1262
|
}
|
|
1215
1263
|
}, {
|
|
1216
1264
|
key: "setTemp",
|
|
1217
|
-
value: function setTemp(
|
|
1218
|
-
return (_setTemp2 = _setTemp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1265
|
+
value: function setTemp(_x25, _x26, _x27) {
|
|
1266
|
+
return (_setTemp2 = _setTemp2 || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16(obj, key, value) {
|
|
1219
1267
|
var sendChanges,
|
|
1220
|
-
|
|
1221
|
-
return _regeneratorRuntime().wrap(function
|
|
1222
|
-
while (1) switch (
|
|
1268
|
+
_args16 = arguments;
|
|
1269
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1270
|
+
while (1) switch (_context16.prev = _context16.next) {
|
|
1223
1271
|
case 0:
|
|
1224
|
-
sendChanges =
|
|
1272
|
+
sendChanges = _args16.length > 3 && _args16[3] !== undefined ? _args16[3] : false;
|
|
1225
1273
|
if (!(_typeof(obj) !== "object" || !obj || Array.isArray(obj))) {
|
|
1226
|
-
|
|
1274
|
+
_context16.next = 3;
|
|
1227
1275
|
break;
|
|
1228
1276
|
}
|
|
1229
|
-
return
|
|
1277
|
+
return _context16.abrupt("return");
|
|
1230
1278
|
case 3:
|
|
1231
1279
|
if (!(obj instanceof SimpleObject)) {
|
|
1232
|
-
|
|
1280
|
+
_context16.next = 7;
|
|
1233
1281
|
break;
|
|
1234
1282
|
}
|
|
1235
|
-
|
|
1283
|
+
_context16.next = 6;
|
|
1236
1284
|
return obj.setTemp(key, value, sendChanges);
|
|
1237
1285
|
case 6:
|
|
1238
|
-
return
|
|
1286
|
+
return _context16.abrupt("return", _context16.sent);
|
|
1239
1287
|
case 7:
|
|
1240
1288
|
//
|
|
1241
1289
|
if (obj.__temp == null) obj.__temp = {};
|
|
1242
1290
|
(0, _object.object_set)(obj.__temp, key, value);
|
|
1243
1291
|
case 9:
|
|
1244
1292
|
case "end":
|
|
1245
|
-
return
|
|
1293
|
+
return _context16.stop();
|
|
1246
1294
|
}
|
|
1247
|
-
},
|
|
1295
|
+
}, _callee16);
|
|
1248
1296
|
}))).apply(this, arguments);
|
|
1249
1297
|
}
|
|
1250
1298
|
}, {
|
|
@@ -1255,36 +1303,36 @@ var SimpleObject = /*#__PURE__*/function (_MapableObject, _setValue, _setTemp, _
|
|
|
1255
1303
|
}
|
|
1256
1304
|
}, {
|
|
1257
1305
|
key: "delete_cache",
|
|
1258
|
-
value: function delete_cache(
|
|
1259
|
-
return (_delete_cache = _delete_cache || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
1306
|
+
value: function delete_cache(_x28) {
|
|
1307
|
+
return (_delete_cache = _delete_cache || _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(context) {
|
|
1260
1308
|
var cacheKey;
|
|
1261
|
-
return _regeneratorRuntime().wrap(function
|
|
1262
|
-
while (1) switch (
|
|
1309
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1310
|
+
while (1) switch (_context17.prev = _context17.next) {
|
|
1263
1311
|
case 0:
|
|
1264
1312
|
if (this.__cache_name) {
|
|
1265
|
-
|
|
1313
|
+
_context17.next = 2;
|
|
1266
1314
|
break;
|
|
1267
1315
|
}
|
|
1268
|
-
return
|
|
1316
|
+
return _context17.abrupt("return");
|
|
1269
1317
|
case 2:
|
|
1270
1318
|
if (context) {
|
|
1271
|
-
|
|
1319
|
+
_context17.next = 7;
|
|
1272
1320
|
break;
|
|
1273
1321
|
}
|
|
1274
|
-
|
|
1322
|
+
_context17.next = 5;
|
|
1275
1323
|
return _global.gcache.delete_session_cache(this.__cache_name);
|
|
1276
1324
|
case 5:
|
|
1277
|
-
|
|
1325
|
+
_context17.next = 10;
|
|
1278
1326
|
break;
|
|
1279
1327
|
case 7:
|
|
1280
1328
|
cacheKey = "".concat(this.__cache_name, "-").concat(context);
|
|
1281
|
-
|
|
1329
|
+
_context17.next = 10;
|
|
1282
1330
|
return _global.gcache.delete_session_cache(cacheKey);
|
|
1283
1331
|
case 10:
|
|
1284
1332
|
case "end":
|
|
1285
|
-
return
|
|
1333
|
+
return _context17.stop();
|
|
1286
1334
|
}
|
|
1287
|
-
},
|
|
1335
|
+
}, _callee17, this);
|
|
1288
1336
|
}))).apply(this, arguments);
|
|
1289
1337
|
}
|
|
1290
1338
|
}, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@azrico/webobject",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.122",
|
|
4
4
|
"description": "Stateful object",
|
|
5
5
|
"author": "Azrideus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -73,10 +73,10 @@
|
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@azrico/convert": "^1.0.5",
|
|
75
75
|
"@azrico/event": "^1.2.17",
|
|
76
|
-
"@azrico/global": "^1.3.
|
|
76
|
+
"@azrico/global": "^1.3.69",
|
|
77
77
|
"@azrico/math": "^1.0.5",
|
|
78
|
-
"@azrico/object": "^1.4.
|
|
79
|
-
"@azrico/string": "^1.2.
|
|
78
|
+
"@azrico/object": "^1.4.99",
|
|
79
|
+
"@azrico/string": "^1.2.91",
|
|
80
80
|
"@azrico/types": "^1.0.4",
|
|
81
81
|
"@azrico/uid": "^1.0.5"
|
|
82
82
|
},
|