clickgo 3.0.0-dev
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.
- package/LICENSE +201 -0
- package/README.md +75 -0
- package/dist/app/demo/config.json +106 -0
- package/dist/app/demo/form/control/block/block.css +1 -0
- package/dist/app/demo/form/control/block/block.scss +17 -0
- package/dist/app/demo/form/control/block/block.xml +7 -0
- package/dist/app/demo/form/control/button/button.css +1 -0
- package/dist/app/demo/form/control/button/button.js +27 -0
- package/dist/app/demo/form/control/button/button.scss +18 -0
- package/dist/app/demo/form/control/button/button.xml +126 -0
- package/dist/app/demo/form/control/check/check.js +12 -0
- package/dist/app/demo/form/control/check/check.xml +13 -0
- package/dist/app/demo/form/control/dialog/dialog.js +8 -0
- package/dist/app/demo/form/control/dialog/dialog.xml +26 -0
- package/dist/app/demo/form/control/file/file.js +23 -0
- package/dist/app/demo/form/control/file/file.xml +25 -0
- package/dist/app/demo/form/control/form/form.css +1 -0
- package/dist/app/demo/form/control/form/form.js +38 -0
- package/dist/app/demo/form/control/form/form.scss +9 -0
- package/dist/app/demo/form/control/form/form.xml +28 -0
- package/dist/app/demo/form/control/greatview/greatview.css +1 -0
- package/dist/app/demo/form/control/greatview/greatview.js +92 -0
- package/dist/app/demo/form/control/greatview/greatview.scss +22 -0
- package/dist/app/demo/form/control/greatview/greatview.xml +89 -0
- package/dist/app/demo/form/control/img/img.xml +16 -0
- package/dist/app/demo/form/control/label/label.xml +11 -0
- package/dist/app/demo/form/control/list/list.css +1 -0
- package/dist/app/demo/form/control/list/list.js +194 -0
- package/dist/app/demo/form/control/list/list.scss +7 -0
- package/dist/app/demo/form/control/list/list.xml +91 -0
- package/dist/app/demo/form/control/loading/loading.xml +8 -0
- package/dist/app/demo/form/control/marquee/marquee.js +30 -0
- package/dist/app/demo/form/control/marquee/marquee.xml +36 -0
- package/dist/app/demo/form/control/menu/menu.js +8 -0
- package/dist/app/demo/form/control/menu/menu.xml +122 -0
- package/dist/app/demo/form/control/monaco/monaco.js +113 -0
- package/dist/app/demo/form/control/monaco/monaco.xml +27 -0
- package/dist/app/demo/form/control/overflow/overflow.css +1 -0
- package/dist/app/demo/form/control/overflow/overflow.js +70 -0
- package/dist/app/demo/form/control/overflow/overflow.scss +18 -0
- package/dist/app/demo/form/control/overflow/overflow.xml +98 -0
- package/dist/app/demo/form/control/property/property.js +129 -0
- package/dist/app/demo/form/control/property/property.xml +6 -0
- package/dist/app/demo/form/control/radio/radio.js +7 -0
- package/dist/app/demo/form/control/radio/radio.xml +12 -0
- package/dist/app/demo/form/control/scroll/scroll.js +14 -0
- package/dist/app/demo/form/control/scroll/scroll.xml +35 -0
- package/dist/app/demo/form/control/select/select.js +91 -0
- package/dist/app/demo/form/control/select/select.xml +74 -0
- package/dist/app/demo/form/control/tab/tab.js +75 -0
- package/dist/app/demo/form/control/tab/tab.xml +22 -0
- package/dist/app/demo/form/control/text/text.js +53 -0
- package/dist/app/demo/form/control/text/text.xml +37 -0
- package/dist/app/demo/form/control/view/view.css +1 -0
- package/dist/app/demo/form/control/view/view.js +73 -0
- package/dist/app/demo/form/control/view/view.scss +18 -0
- package/dist/app/demo/form/control/view/view.xml +94 -0
- package/dist/app/demo/form/event/form/form.css +1 -0
- package/dist/app/demo/form/event/form/form.js +129 -0
- package/dist/app/demo/form/event/form/form.scss +24 -0
- package/dist/app/demo/form/event/form/form.xml +16 -0
- package/dist/app/demo/form/event/screen/screen.js +51 -0
- package/dist/app/demo/form/event/screen/screen.xml +9 -0
- package/dist/app/demo/form/event/task/task.js +78 -0
- package/dist/app/demo/form/event/task/task.xml +20 -0
- package/dist/app/demo/form/main.css +1 -0
- package/dist/app/demo/form/main.js +25 -0
- package/dist/app/demo/form/main.scss +9 -0
- package/dist/app/demo/form/main.xml +49 -0
- package/dist/app/demo/form/method/core/core.js +25 -0
- package/dist/app/demo/form/method/core/core.xml +7 -0
- package/dist/app/demo/form/method/dom/dom.css +1 -0
- package/dist/app/demo/form/method/dom/dom.js +163 -0
- package/dist/app/demo/form/method/dom/dom.scss +10 -0
- package/dist/app/demo/form/method/dom/dom.xml +55 -0
- package/dist/app/demo/form/method/form/form.css +1 -0
- package/dist/app/demo/form/method/form/form.js +217 -0
- package/dist/app/demo/form/method/form/form.scss +3 -0
- package/dist/app/demo/form/method/form/form.xml +56 -0
- package/dist/app/demo/form/method/form/test.xml +5 -0
- package/dist/app/demo/form/method/fs/fs.js +88 -0
- package/dist/app/demo/form/method/fs/fs.xml +8 -0
- package/dist/app/demo/form/method/fs/text.js +15 -0
- package/dist/app/demo/form/method/fs/text.xml +3 -0
- package/dist/app/demo/form/method/task/locale1.json +3 -0
- package/dist/app/demo/form/method/task/locale2.json +3 -0
- package/dist/app/demo/form/method/task/task.js +153 -0
- package/dist/app/demo/form/method/task/task.xml +57 -0
- package/dist/app/demo/form/method/theme/theme.js +74 -0
- package/dist/app/demo/form/method/theme/theme.xml +9 -0
- package/dist/app/demo/form/method/tool/tool.js +64 -0
- package/dist/app/demo/form/method/tool/tool.xml +26 -0
- package/dist/app/demo/form/method/zip/zip.js +99 -0
- package/dist/app/demo/form/method/zip/zip.xml +12 -0
- package/dist/app/demo/global.css +3 -0
- package/dist/app/demo/res/icon.svg +1 -0
- package/dist/app/demo/res/img.jpg +0 -0
- package/dist/app/demo/res/r-1.svg +1 -0
- package/dist/app/demo/res/r-2.svg +1 -0
- package/dist/app/demo/res/sql.svg +1 -0
- package/dist/app/demo/res/txt.svg +1 -0
- package/dist/app/demo/res/zip.svg +1 -0
- package/dist/app/task/config.json +29 -0
- package/dist/app/task/form/bar/bar.js +299 -0
- package/dist/app/task/form/bar/bar.xml +47 -0
- package/dist/app/task/form/desktop/desktop.xml +1 -0
- package/dist/app/task/locale/en.json +11 -0
- package/dist/app/task/locale/ja.json +11 -0
- package/dist/app/task/locale/sc.json +11 -0
- package/dist/app/task/locale/tc.json +11 -0
- package/dist/clickgo.js +41 -0
- package/dist/clickgo.ts +51 -0
- package/dist/control/common.cgc +0 -0
- package/dist/control/form.cgc +0 -0
- package/dist/control/monaco.cgc +0 -0
- package/dist/control/property.cgc +0 -0
- package/dist/control/task.cgc +0 -0
- package/dist/global.css +1 -0
- package/dist/icon.png +0 -0
- package/dist/index.js +88 -0
- package/dist/index.ts +92 -0
- package/dist/lib/control.js +365 -0
- package/dist/lib/control.ts +428 -0
- package/dist/lib/core.js +668 -0
- package/dist/lib/core.ts +732 -0
- package/dist/lib/dom.js +1471 -0
- package/dist/lib/dom.ts +1785 -0
- package/dist/lib/form.js +2101 -0
- package/dist/lib/form.ts +2496 -0
- package/dist/lib/fs.js +849 -0
- package/dist/lib/fs.ts +995 -0
- package/dist/lib/native.js +138 -0
- package/dist/lib/native.ts +219 -0
- package/dist/lib/task.js +686 -0
- package/dist/lib/task.ts +842 -0
- package/dist/lib/theme.js +159 -0
- package/dist/lib/theme.ts +196 -0
- package/dist/lib/tool.js +501 -0
- package/dist/lib/tool.ts +620 -0
- package/dist/lib/zip.js +352 -0
- package/dist/lib/zip.ts +434 -0
- package/dist/theme/familiar.cgt +0 -0
- package/package.json +27 -0
- package/types/dev.d.ts +30 -0
- package/types/index.d.ts +673 -0
package/dist/lib/zip.js
ADDED
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.get = exports.Zip = void 0;
|
|
13
|
+
const jszip = require("jszip");
|
|
14
|
+
const tool = require("./tool");
|
|
15
|
+
class Zip {
|
|
16
|
+
constructor(zip) {
|
|
17
|
+
this._path = '/';
|
|
18
|
+
this._list = {};
|
|
19
|
+
this._zip = zip;
|
|
20
|
+
this._refreshList();
|
|
21
|
+
}
|
|
22
|
+
getContent(path, type = 'string') {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
path = tool.urlResolve(this._path, path);
|
|
25
|
+
const f = this._zip.file(path.slice(1));
|
|
26
|
+
if (!f) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
if (type === 'string') {
|
|
30
|
+
return f.async('string');
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
return f.async(type);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
putContent(path, data, options = {}) {
|
|
38
|
+
path = tool.urlResolve(this._path, path);
|
|
39
|
+
this._zip.file(path.slice(1), data, {
|
|
40
|
+
'base64': options.base64,
|
|
41
|
+
'binary': options.binary,
|
|
42
|
+
'date': options.date
|
|
43
|
+
});
|
|
44
|
+
this._refreshList();
|
|
45
|
+
}
|
|
46
|
+
unlink(path) {
|
|
47
|
+
path = tool.urlResolve(this._path, path);
|
|
48
|
+
this._zip.remove(path.slice(1));
|
|
49
|
+
this._refreshList();
|
|
50
|
+
}
|
|
51
|
+
stats(path) {
|
|
52
|
+
path = tool.urlResolve(this._path, path);
|
|
53
|
+
let dirpath = path.endsWith('/') ? path : path + '/';
|
|
54
|
+
if (!this._list[dirpath]) {
|
|
55
|
+
if (path.endsWith('/')) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const lio = path.lastIndexOf('/') + 1;
|
|
59
|
+
const dpath = path.slice(0, lio);
|
|
60
|
+
const fname = path.slice(lio);
|
|
61
|
+
if (!this._list[dpath]) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
const file = this._list[dpath][fname];
|
|
65
|
+
if (!file) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
'date': file.date,
|
|
70
|
+
'isFile': true,
|
|
71
|
+
'isDirectory': false
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
if (dirpath === '/') {
|
|
76
|
+
return {
|
|
77
|
+
'date': new Date(),
|
|
78
|
+
'isFile': false,
|
|
79
|
+
'isDirectory': true
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
dirpath = dirpath.slice(0, -1);
|
|
83
|
+
const lio = dirpath.lastIndexOf('/') + 1;
|
|
84
|
+
const dpath = dirpath.slice(0, lio);
|
|
85
|
+
const fname = dirpath.slice(lio);
|
|
86
|
+
const pfolder = this._list[dpath];
|
|
87
|
+
const folder = pfolder[fname];
|
|
88
|
+
return {
|
|
89
|
+
'date': folder.date,
|
|
90
|
+
'isFile': false,
|
|
91
|
+
'isDirectory': true
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
isDir(path) {
|
|
96
|
+
const pstats = this.stats(path);
|
|
97
|
+
if (!pstats || !pstats.isDirectory) {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
return pstats;
|
|
101
|
+
}
|
|
102
|
+
isFile(path) {
|
|
103
|
+
const pstats = this.stats(path);
|
|
104
|
+
if (!pstats || !pstats.isFile) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
return pstats;
|
|
108
|
+
}
|
|
109
|
+
readDir(path, opt = {}) {
|
|
110
|
+
if (opt.hasChildren === undefined) {
|
|
111
|
+
opt.hasChildren = false;
|
|
112
|
+
}
|
|
113
|
+
if (opt.hasDir === undefined) {
|
|
114
|
+
opt.hasDir = true;
|
|
115
|
+
}
|
|
116
|
+
if (opt.pathAsKey === undefined) {
|
|
117
|
+
opt.pathAsKey = false;
|
|
118
|
+
}
|
|
119
|
+
if (!path) {
|
|
120
|
+
path = this._path;
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
path = tool.urlResolve(this._path, path);
|
|
124
|
+
}
|
|
125
|
+
if (!path.endsWith('/')) {
|
|
126
|
+
path += '/';
|
|
127
|
+
}
|
|
128
|
+
const folder = this._zip.folder(path.slice(1));
|
|
129
|
+
if (!folder) {
|
|
130
|
+
return opt.pathAsKey ? {} : [];
|
|
131
|
+
}
|
|
132
|
+
if (!this._list[path]) {
|
|
133
|
+
return opt.pathAsKey ? {} : [];
|
|
134
|
+
}
|
|
135
|
+
if (!opt.hasChildren) {
|
|
136
|
+
if (opt.pathAsKey) {
|
|
137
|
+
return this._list[path];
|
|
138
|
+
}
|
|
139
|
+
const list = [];
|
|
140
|
+
for (const k in this._list[path]) {
|
|
141
|
+
list.push(this._list[path][k]);
|
|
142
|
+
}
|
|
143
|
+
return list;
|
|
144
|
+
}
|
|
145
|
+
if (opt.pathAsKey) {
|
|
146
|
+
const list = {};
|
|
147
|
+
for (const k in this._list[path]) {
|
|
148
|
+
const item = this._list[path][k];
|
|
149
|
+
if (item.isFile || opt.hasDir) {
|
|
150
|
+
list[item.path + item.name] = item;
|
|
151
|
+
}
|
|
152
|
+
if (item.isDirectory) {
|
|
153
|
+
Object.assign(list, this._readDir(item, {
|
|
154
|
+
'hasDir': opt.hasDir,
|
|
155
|
+
'pathAsKey': opt.pathAsKey
|
|
156
|
+
}));
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return list;
|
|
160
|
+
}
|
|
161
|
+
else {
|
|
162
|
+
let list = [];
|
|
163
|
+
for (const k in this._list[path]) {
|
|
164
|
+
const item = this._list[path][k];
|
|
165
|
+
if (item.isFile || opt.hasDir) {
|
|
166
|
+
list.push(item);
|
|
167
|
+
}
|
|
168
|
+
if (item.isDirectory) {
|
|
169
|
+
list = list.concat(this._readDir(item, {
|
|
170
|
+
'hasDir': opt.hasDir,
|
|
171
|
+
'pathAsKey': opt.pathAsKey
|
|
172
|
+
}));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return list;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
_readDir(item, opt) {
|
|
179
|
+
if (opt.pathAsKey) {
|
|
180
|
+
const list = {};
|
|
181
|
+
if (!this._list[item.path + item.name + '/']) {
|
|
182
|
+
return {};
|
|
183
|
+
}
|
|
184
|
+
for (const k in this._list[item.path + item.name + '/']) {
|
|
185
|
+
const it = this._list[item.path + item.name + '/'][k];
|
|
186
|
+
if (it.isFile || opt.hasDir) {
|
|
187
|
+
list[it.path + it.name] = it;
|
|
188
|
+
}
|
|
189
|
+
if (it.isDirectory) {
|
|
190
|
+
Object.assign(list, this._readDir(it, {
|
|
191
|
+
'hasDir': opt.hasDir,
|
|
192
|
+
'pathAsKey': opt.pathAsKey
|
|
193
|
+
}));
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
return list;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
let list = [];
|
|
200
|
+
if (!this._list[item.path + item.name + '/']) {
|
|
201
|
+
return [];
|
|
202
|
+
}
|
|
203
|
+
for (const k in this._list[item.path + item.name + '/']) {
|
|
204
|
+
const it = this._list[item.path + item.name + '/'][k];
|
|
205
|
+
if (it.isFile || opt.hasDir) {
|
|
206
|
+
list.push(it);
|
|
207
|
+
}
|
|
208
|
+
if (it.isDirectory) {
|
|
209
|
+
list = list.concat(this._readDir(it, {
|
|
210
|
+
'hasDir': opt.hasDir,
|
|
211
|
+
'pathAsKey': opt.pathAsKey
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return list;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
_refreshList() {
|
|
219
|
+
const list = {};
|
|
220
|
+
this._zip.forEach(function (relativePath, item) {
|
|
221
|
+
if (relativePath.startsWith('/')) {
|
|
222
|
+
relativePath = relativePath.slice(1);
|
|
223
|
+
}
|
|
224
|
+
let parentPath = '/';
|
|
225
|
+
let name = '';
|
|
226
|
+
let s;
|
|
227
|
+
if (item.dir) {
|
|
228
|
+
s = relativePath.slice(0, -1).lastIndexOf('/');
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
s = relativePath.lastIndexOf('/');
|
|
232
|
+
}
|
|
233
|
+
if (s !== -1) {
|
|
234
|
+
parentPath = '/' + relativePath.slice(0, s + 1);
|
|
235
|
+
name = relativePath.slice(s + 1);
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
name = relativePath;
|
|
239
|
+
}
|
|
240
|
+
if (item.dir) {
|
|
241
|
+
name = name.slice(0, -1);
|
|
242
|
+
}
|
|
243
|
+
if (!list[parentPath]) {
|
|
244
|
+
list[parentPath] = {};
|
|
245
|
+
}
|
|
246
|
+
list[parentPath][name] = {
|
|
247
|
+
'name': name,
|
|
248
|
+
'date': item.date,
|
|
249
|
+
'isFile': !item.dir,
|
|
250
|
+
'isDirectory': item.dir,
|
|
251
|
+
'path': parentPath
|
|
252
|
+
};
|
|
253
|
+
});
|
|
254
|
+
this._list = list;
|
|
255
|
+
}
|
|
256
|
+
pwd() {
|
|
257
|
+
return this._path.slice(0, -1);
|
|
258
|
+
}
|
|
259
|
+
cd(dir) {
|
|
260
|
+
this._path = tool.urlResolve(this._path, dir);
|
|
261
|
+
if (!this._path.endsWith('/')) {
|
|
262
|
+
this._path += '/';
|
|
263
|
+
}
|
|
264
|
+
return this._path;
|
|
265
|
+
}
|
|
266
|
+
generate(options = {}) {
|
|
267
|
+
const opt = {};
|
|
268
|
+
if (options.type === undefined) {
|
|
269
|
+
opt.type = 'blob';
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
opt.type = options.type;
|
|
273
|
+
}
|
|
274
|
+
if (options.level === undefined) {
|
|
275
|
+
options.level = 9;
|
|
276
|
+
}
|
|
277
|
+
else if (options.level > 9) {
|
|
278
|
+
options.level = 9;
|
|
279
|
+
}
|
|
280
|
+
if (options.level > 0) {
|
|
281
|
+
opt.compression = 'DEFLATE';
|
|
282
|
+
}
|
|
283
|
+
return this._zip.generateAsync(opt, function (meta) {
|
|
284
|
+
var _a;
|
|
285
|
+
(_a = options.onUpdate) === null || _a === void 0 ? void 0 : _a.call(options, meta.percent, meta.currentFile);
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
getList() {
|
|
289
|
+
return new Promise((resolve) => {
|
|
290
|
+
const files = {};
|
|
291
|
+
const list = this.readDir('/', {
|
|
292
|
+
'hasChildren': true,
|
|
293
|
+
'hasDir': false
|
|
294
|
+
});
|
|
295
|
+
let loaded = 0;
|
|
296
|
+
for (const file of list) {
|
|
297
|
+
const mime = tool.getMimeByPath(file.name);
|
|
298
|
+
if (['txt', 'json', 'js', 'css', 'xml', 'html'].includes(mime.ext)) {
|
|
299
|
+
this.getContent(file.path + file.name, 'string').then(function (fb) {
|
|
300
|
+
if (fb) {
|
|
301
|
+
files[file.path + file.name] = fb;
|
|
302
|
+
}
|
|
303
|
+
++loaded;
|
|
304
|
+
if (loaded === list.length) {
|
|
305
|
+
resolve(files);
|
|
306
|
+
}
|
|
307
|
+
}).catch(function () {
|
|
308
|
+
++loaded;
|
|
309
|
+
if (loaded === list.length) {
|
|
310
|
+
resolve(files);
|
|
311
|
+
}
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
else {
|
|
315
|
+
this.getContent(file.path + file.name, 'arraybuffer').then(function (fb) {
|
|
316
|
+
if (fb) {
|
|
317
|
+
files[file.path + file.name] = new Blob([fb], {
|
|
318
|
+
'type': mime.mime
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
++loaded;
|
|
322
|
+
if (loaded === list.length) {
|
|
323
|
+
resolve(files);
|
|
324
|
+
}
|
|
325
|
+
}).catch(function () {
|
|
326
|
+
++loaded;
|
|
327
|
+
if (loaded === list.length) {
|
|
328
|
+
resolve(files);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return files;
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
exports.Zip = Zip;
|
|
338
|
+
function get(data) {
|
|
339
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
340
|
+
const z = jszip();
|
|
341
|
+
try {
|
|
342
|
+
if (data) {
|
|
343
|
+
yield z.loadAsync(data);
|
|
344
|
+
}
|
|
345
|
+
return new Zip(z);
|
|
346
|
+
}
|
|
347
|
+
catch (_a) {
|
|
348
|
+
return null;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
}
|
|
352
|
+
exports.get = get;
|