@azrico/webobject 1.4.25 → 1.4.26
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.
|
@@ -52,6 +52,8 @@ export declare class WebObject extends SimpleObject {
|
|
|
52
52
|
* @returns value or undefined
|
|
53
53
|
*/
|
|
54
54
|
static getMetaValue(o: WebObject | null | undefined, key: string): any;
|
|
55
|
+
static zipSaveList(svlist: any): string;
|
|
56
|
+
static unzipSaveList(svlist: any): any;
|
|
55
57
|
static saveList(itemList: WebObject[], extraOptions?: {
|
|
56
58
|
[key: string]: any;
|
|
57
59
|
}): Promise<boolean>;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports["default"] = exports.WebObject = void 0;
|
|
7
7
|
var _SimpleObject2 = _interopRequireDefault(require("../structs/SimpleObject"));
|
|
8
8
|
var _object = require("@azrico/object");
|
|
9
|
+
var _string = require("@azrico/string");
|
|
9
10
|
var _global = require("@azrico/global");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
11
12
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
@@ -580,6 +581,21 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
580
581
|
/* -------------------------------------------------------------------------- */
|
|
581
582
|
/* Save */
|
|
582
583
|
/* -------------------------------------------------------------------------- */
|
|
584
|
+
}, {
|
|
585
|
+
key: "zipSaveList",
|
|
586
|
+
value: function zipSaveList(svlist) {
|
|
587
|
+
if (_typeof(svlist) === "object") svlist = JSON.stringify(svlist);
|
|
588
|
+
return (0, _string.string_compress)(svlist);
|
|
589
|
+
}
|
|
590
|
+
}, {
|
|
591
|
+
key: "unzipSaveList",
|
|
592
|
+
value: function unzipSaveList(svlist) {
|
|
593
|
+
try {
|
|
594
|
+
if (_typeof(svlist) === "object") return svlist;
|
|
595
|
+
if (typeof svlist === "string") return JSON.parse((0, _string.string_decompress)(svlist));
|
|
596
|
+
} catch (_unused) {}
|
|
597
|
+
return svlist;
|
|
598
|
+
}
|
|
583
599
|
}, {
|
|
584
600
|
key: "saveList",
|
|
585
601
|
value: function () {
|
|
@@ -638,7 +654,7 @@ var WebObject = /*#__PURE__*/function (_SimpleObject) {
|
|
|
638
654
|
case 19:
|
|
639
655
|
_context11.next = 21;
|
|
640
656
|
return _global.gfunc.run_action("post", putAddress, _objectSpread({
|
|
641
|
-
__save_list: save_array
|
|
657
|
+
__save_list: WebObject.zipSaveList(save_array)
|
|
642
658
|
}, extraOptions));
|
|
643
659
|
case 21:
|
|
644
660
|
resultObject = _context11.sent;
|