datafolder 1.0.2 → 1.0.3
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/README.md +9 -3
- package/index.js +2 -3
- package/package.json +3 -2
- package/sample.js +37 -37
- package/scripts/airbnb.js +10 -11
- package/scripts/airbnb2.js +10 -11
- package/scripts/airbnb2_queries.js +11 -11
- package/scripts/airbnb_queries.js +15 -14
- package/scripts/downloadFile.js +29 -31
- package/scripts/express.js +5 -4
- package/scripts/fastify.js +12 -11
- package/scripts/flights.js +8 -8
- package/scripts/flights2.js +9 -9
- package/scripts/flights2_queries.js +19 -16
- package/scripts/flights_queries.js +18 -13
- package/src/QyAcl.js +153 -152
- package/src/QyAclSaver.js +16 -10
- package/src/QyAclSaver_Worker.js +21 -15
- package/src/QyAclWriter.js +23 -13
- package/src/QyBatch.js +298 -263
- package/src/QyBinWriter.js +49 -37
- package/src/QyCD.js +13 -14
- package/src/QyCache.js +177 -140
- package/src/QyCompressor.js +71 -45
- package/src/QyCompressor_Worker.js +17 -9
- package/src/QyDB.js +41 -12
- package/src/QyDefaultOptions.js +13 -10
- package/src/QyDir.js +89 -53
- package/src/QyFetch.js +27 -24
- package/src/QyFile.js +89 -77
- package/src/QyFileContentUtils.js +129 -132
- package/src/QyFileLogger.js +63 -41
- package/src/QyIndex.js +175 -197
- package/src/QyIndexPropTree.js +25 -25
- package/src/QyIntersectNode.js +34 -31
- package/src/QyItem.js +54 -52
- package/src/QyJsonSaver.js +12 -6
- package/src/QyKVData.js +279 -245
- package/src/QyKVDataCleaner.js +12 -6
- package/src/QyKVDataCleaner_Worker.js +77 -59
- package/src/QyKVDataLoader.js +67 -46
- package/src/QyKVDataSaver.js +15 -9
- package/src/QyKVDataSaver_Worker.js +83 -60
- package/src/QyLogFileSaver.js +12 -6
- package/src/QyLogFileSaver_Worker.js +24 -14
- package/src/QyLogger.js +51 -40
- package/src/QyMessageWorker.js +43 -29
- package/src/QyMessager.js +74 -54
- package/src/QyMessager_Run.js +20 -7
- package/src/QyMod.js +15 -11
- package/src/QyOpRunner.js +58 -41
- package/src/QyQueue.js +35 -30
- package/src/QySaver.js +52 -29
- package/src/QySnapshotCompactor.js +15 -9
- package/src/QySnapshotCompactor_Worker.js +131 -110
- package/src/QySnapshotSaver.js +15 -9
- package/src/QySnapshotSaver_Worker.js +125 -110
- package/src/QySnapshots.js +260 -241
- package/src/QyStructure.js +35 -27
- package/src/QyTrigger.js +62 -55
- package/src/QyUnionNode.js +54 -56
- package/src/QyUtils.js +170 -158
- package/src/QyWorker.js +34 -20
- package/src/hackernews.js +63 -71
- package/src/rpc/getFileContent.js +7 -7
- package/src/rpc/getSubItems.js +22 -22
- package/src/simulate.js +85 -80
- package/src/simulate2.js +77 -78
- package/src/soc_pokec.js +44 -32
- package/static/datafolderui/QyStyledElement.js +12 -12
- package/static/datafolderui/QyUIFolderTree.js +20 -20
- package/static/datafolderui/QyUIUtils.js +8 -8
- package/static/datafolderui/explore-tree.js +31 -31
- package/static/datafolderui/folder-tree.js +2 -2
- package/static/datafolderui/hscrpt.js +9 -17
- package/static/datafolderui/json-view.js +3 -5
- package/static/datafolderui/kv-input.js +15 -15
- package/static/datafolderui/list-input.js +17 -17
- package/static/datafolderui/main-page.js +18 -18
- package/static/datafolderui/num-input.js +5 -5
- package/static/datafolderui/querySelectorShadowRoot.js +15 -19
- package/static/datafolderui/resizable-input.js +18 -18
package/src/QyCompressor.js
CHANGED
|
@@ -1,60 +1,86 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import {
|
|
2
|
+
extname as i
|
|
3
|
+
} from "node:path";
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
pipeline as e
|
|
7
|
+
} from "node:stream";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
promisify as r
|
|
11
|
+
} from "node:util";
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
createGzip as s,
|
|
15
|
+
createUnzip as a
|
|
16
|
+
} from "node:zlib";
|
|
17
|
+
|
|
18
|
+
import {
|
|
19
|
+
createReadStream as n,
|
|
20
|
+
createWriteStream as p
|
|
21
|
+
} from "node:fs";
|
|
22
|
+
|
|
23
|
+
import m from "node:fs/promises";
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
logger as d
|
|
27
|
+
} from "./QyLogger.js";
|
|
28
|
+
|
|
29
|
+
import {
|
|
30
|
+
isNotNullObj as t,
|
|
31
|
+
folderOrFileExists as l,
|
|
32
|
+
ensureParentDir as c
|
|
33
|
+
} from "./QyUtils.js";
|
|
34
|
+
|
|
35
|
+
import {
|
|
36
|
+
runOnceWithWorker as f
|
|
37
|
+
} from "./QyWorker.js";
|
|
38
|
+
|
|
39
|
+
let h = r(e), g = ".gz", w = "QyCompressor_Worker.js";
|
|
40
|
+
|
|
41
|
+
function o(e, r, o) {
|
|
42
|
+
return t(r) && (o = r, r = void 0), r = r || e + g, o = o || {}, e.endsWith(g) ? (d.log(e + " already ends with .gz."),
|
|
43
|
+
!1) : r.endsWith(g) ? f(w, {
|
|
17
44
|
operation: "compress",
|
|
18
45
|
srcFilePath: e,
|
|
19
|
-
destFilePath:
|
|
20
|
-
options:
|
|
21
|
-
}).promise : (
|
|
46
|
+
destFilePath: r,
|
|
47
|
+
options: o
|
|
48
|
+
}).promise : (d.log(r + " doesn't end with .gz."), !1);
|
|
22
49
|
}
|
|
23
50
|
|
|
24
|
-
function
|
|
25
|
-
return e.endsWith(
|
|
26
|
-
|
|
27
|
-
!1) : runOnceWithWorker(compressorWorkerJsFileName, {
|
|
51
|
+
function u(e, r, o) {
|
|
52
|
+
return e.endsWith(g) ? (t(r) && (o = r, r = void 0), r = r || e.replace(new RegExp(g + "$"), ""),
|
|
53
|
+
o = o || {}, i(r) == g ? (d.log(r + " already ends with .gz."), !1) : f(w, {
|
|
28
54
|
operation: "decompress",
|
|
29
55
|
srcFilePath: e,
|
|
30
|
-
destFilePath:
|
|
31
|
-
options:
|
|
32
|
-
}).promise) : (
|
|
56
|
+
destFilePath: r,
|
|
57
|
+
options: o
|
|
58
|
+
}).promise) : (d.log(e + " doesn't end with .gz."), !1);
|
|
33
59
|
}
|
|
34
60
|
|
|
35
|
-
async function
|
|
61
|
+
async function F({
|
|
36
62
|
operation: e,
|
|
37
|
-
srcFilePath:
|
|
38
|
-
destFilePath:
|
|
39
|
-
options:
|
|
63
|
+
srcFilePath: r,
|
|
64
|
+
destFilePath: o,
|
|
65
|
+
options: i
|
|
40
66
|
}) {
|
|
41
67
|
var {
|
|
42
|
-
removeSrcAfterSuccess:
|
|
43
|
-
override:
|
|
44
|
-
} =
|
|
45
|
-
if (!await
|
|
46
|
-
if (!
|
|
47
|
-
if (await
|
|
48
|
-
|
|
49
|
-
await
|
|
68
|
+
removeSrcAfterSuccess: i,
|
|
69
|
+
override: t
|
|
70
|
+
} = i;
|
|
71
|
+
if (!await l(r)) throw new Error(r + " doesn't exist.");
|
|
72
|
+
if (!t && await l(o)) throw new Error(o + " already exists.");
|
|
73
|
+
if (await c(o), await h(n(r), ("compress" == e ? s : a)(), p(o)), d.info(e + `ed ${r} to ${o}.`),
|
|
74
|
+
i) try {
|
|
75
|
+
await m.unlink(r), d.info("Unlinked " + r);
|
|
50
76
|
} catch (e) {
|
|
51
|
-
|
|
77
|
+
d.error(`Failed to unlink ${r}:`, e);
|
|
52
78
|
}
|
|
53
79
|
}
|
|
54
80
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
81
|
+
export {
|
|
82
|
+
g as Zip_File_Extension,
|
|
83
|
+
o as compressFile,
|
|
84
|
+
u as decompressFile,
|
|
85
|
+
F as runOperation
|
|
86
|
+
};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
parentPort,
|
|
3
|
-
getEnvironmentData,
|
|
4
|
-
workerData
|
|
5
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
parentPort as e,
|
|
3
|
+
getEnvironmentData as r,
|
|
4
|
+
workerData as o
|
|
5
|
+
} from "node:worker_threads";
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import {
|
|
8
|
+
logger as a
|
|
9
|
+
} from "./QyLogger.js";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
runOperation as s
|
|
13
|
+
} from "./QyCompressor.js";
|
|
14
|
+
|
|
15
|
+
a.level = r("logLevel"), (async () => {
|
|
8
16
|
try {
|
|
9
|
-
await
|
|
10
|
-
} catch (
|
|
11
|
-
|
|
17
|
+
await s(o), e.postMessage(!0);
|
|
18
|
+
} catch (r) {
|
|
19
|
+
e.postMessage(r);
|
|
12
20
|
}
|
|
13
21
|
})();
|
package/src/QyDB.js
CHANGED
|
@@ -1,11 +1,40 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
join as e
|
|
3
|
+
} from "node:path";
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
import {
|
|
6
|
+
QyFetch as r
|
|
7
|
+
} from "./QyFetch.js";
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
QyBatch as i
|
|
11
|
+
} from "./QyBatch.js";
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
QyCache as n
|
|
15
|
+
} from "./QyCache.js";
|
|
16
|
+
|
|
17
|
+
import {
|
|
18
|
+
getDefaultOptions as a
|
|
19
|
+
} from "./QyDefaultOptions.js";
|
|
20
|
+
|
|
21
|
+
import {
|
|
22
|
+
QyCD as t
|
|
23
|
+
} from "./QyCD.js";
|
|
24
|
+
|
|
25
|
+
import {
|
|
26
|
+
isNotNullObj as s,
|
|
27
|
+
__dirname as m
|
|
28
|
+
} from "./QyUtils.js";
|
|
29
|
+
|
|
30
|
+
let d = e(m, "../data/sampleDataFolder");
|
|
31
|
+
|
|
32
|
+
class h extends t {
|
|
33
|
+
constructor(e = d, t) {
|
|
34
|
+
s(e) && (t = e, e = d), super(), Object.assign(this, {
|
|
6
35
|
rootFolder: e,
|
|
7
36
|
options: {
|
|
8
|
-
...
|
|
37
|
+
...a("QyDB"),
|
|
9
38
|
...t
|
|
10
39
|
}
|
|
11
40
|
});
|
|
@@ -15,11 +44,11 @@ class QyDB extends QyCD {
|
|
|
15
44
|
return this.qyCache || (e = {
|
|
16
45
|
...this.options,
|
|
17
46
|
...e
|
|
18
|
-
}, t = new
|
|
47
|
+
}, t = new n(this.rootFolder, e, this), Object.assign(this, {
|
|
19
48
|
qyCache: t,
|
|
20
|
-
fetch: new
|
|
21
|
-
batch: new
|
|
22
|
-
_immediate: new
|
|
49
|
+
fetch: new r(t),
|
|
50
|
+
batch: new i(t, e),
|
|
51
|
+
_immediate: new i(t, e)
|
|
23
52
|
}), await t.start()), this;
|
|
24
53
|
}
|
|
25
54
|
async stop() {
|
|
@@ -117,6 +146,6 @@ class QyDB extends QyCD {
|
|
|
117
146
|
}
|
|
118
147
|
}
|
|
119
148
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
149
|
+
export {
|
|
150
|
+
h as QyDB
|
|
151
|
+
};
|
package/src/QyDefaultOptions.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
var e = {
|
|
2
2
|
append: !1,
|
|
3
3
|
retryIntervalFactor: 2,
|
|
4
4
|
maxRetryInterval: 60,
|
|
5
5
|
emitSaveEvent: !1,
|
|
6
6
|
maxFileSize: 1 / 0
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
let t = {
|
|
10
|
+
QyBaseWriter: e,
|
|
11
|
+
QyBinWriter: e,
|
|
10
12
|
QyBatch: {
|
|
11
13
|
fileLogLevel: "delta",
|
|
12
14
|
maxHistoryCmdObjCount: 100
|
|
@@ -20,7 +22,8 @@ let writerConfig = {
|
|
|
20
22
|
compactSnapshotsInterval: 6e4,
|
|
21
23
|
bgLoadPosMaps: !0,
|
|
22
24
|
unloadMemInterval: 12e4,
|
|
23
|
-
maxFileCountToUnload: 1e5
|
|
25
|
+
maxFileCountToUnload: 1e5,
|
|
26
|
+
compactAtStart: !0
|
|
24
27
|
},
|
|
25
28
|
QyCache: {
|
|
26
29
|
dumpStructureAtStart: !1,
|
|
@@ -50,10 +53,10 @@ let writerConfig = {
|
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
|
|
53
|
-
function
|
|
54
|
-
return e &&
|
|
56
|
+
function a(e) {
|
|
57
|
+
return e && t[e] || void 0;
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
+
export {
|
|
61
|
+
a as getDefaultOptions
|
|
62
|
+
};
|
package/src/QyDir.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
SpecialFilePaths,
|
|
5
|
-
arrayLast
|
|
6
|
-
} = require("./QyUtils.js"), QyFile = require("./QyFile.js").QyFile, HiddenFolderName = SpecialFilePaths.HiddenFolderName;
|
|
1
|
+
import {
|
|
2
|
+
QyItem as e
|
|
3
|
+
} from "./QyItem.js";
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
import {
|
|
6
|
+
getSubdirMapKey as i,
|
|
7
|
+
getFileMapKey as t,
|
|
8
|
+
SpecialFilePaths as r,
|
|
9
|
+
arrayLast as s
|
|
10
|
+
} from "./QyUtils.js";
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
QyFile as a
|
|
14
|
+
} from "./QyFile.js";
|
|
15
|
+
|
|
16
|
+
let d = r.HiddenFolderName;
|
|
17
|
+
|
|
18
|
+
class u extends e {
|
|
9
19
|
constructor(e, i, t, r) {
|
|
10
20
|
super(e, i, t), r && (this._qyCache = r), Object.assign(this, {
|
|
11
21
|
_subdirCount: 0,
|
|
@@ -26,10 +36,10 @@ class QyDir extends QyItem {
|
|
|
26
36
|
++i.subdirMapChangeCount);
|
|
27
37
|
}
|
|
28
38
|
get fileCount() {
|
|
29
|
-
return this
|
|
39
|
+
return n(this), this._fileCount;
|
|
30
40
|
}
|
|
31
41
|
get subdirCount() {
|
|
32
|
-
return this
|
|
42
|
+
return l(this), this._subdirCount;
|
|
33
43
|
}
|
|
34
44
|
get isDir() {
|
|
35
45
|
return !0;
|
|
@@ -38,19 +48,19 @@ class QyDir extends QyItem {
|
|
|
38
48
|
return 0 == this.fileCount && 0 == this.subdirCount;
|
|
39
49
|
}
|
|
40
50
|
get isHiddenFolder() {
|
|
41
|
-
return this.name ==
|
|
51
|
+
return this.name == d;
|
|
42
52
|
}
|
|
43
53
|
get subdirMapKey() {
|
|
44
|
-
return this._subdirMapKey || (this._subdirMapKey =
|
|
54
|
+
return this._subdirMapKey || (this._subdirMapKey = i(this.fullPathHash));
|
|
45
55
|
}
|
|
46
56
|
get fileMapKey() {
|
|
47
|
-
return this._fileMapKey || (this._fileMapKey =
|
|
57
|
+
return this._fileMapKey || (this._fileMapKey = t(this.fullPathHash));
|
|
48
58
|
}
|
|
49
59
|
get subdirMap() {
|
|
50
|
-
return this
|
|
60
|
+
return l(this), this._subdirMap;
|
|
51
61
|
}
|
|
52
62
|
get fileMap() {
|
|
53
|
-
return this
|
|
63
|
+
return n(this), this._fileMap;
|
|
54
64
|
}
|
|
55
65
|
getSubdir(e) {
|
|
56
66
|
var i;
|
|
@@ -70,13 +80,13 @@ class QyDir extends QyItem {
|
|
|
70
80
|
if ("/" === e) return this.qyCache.rootDir;
|
|
71
81
|
let t = this.subdirMap;
|
|
72
82
|
var r = (t = t || (this._subdirMap = {}))[e];
|
|
73
|
-
return r || (r = t[e] = new
|
|
83
|
+
return r || (r = t[e] = new u(e, i, this), this.setChildTriggerNodes(r)),
|
|
74
84
|
r;
|
|
75
85
|
}
|
|
76
86
|
getOrCreateFile(e, i) {
|
|
77
87
|
let t = this.fileMap;
|
|
78
88
|
var r = (t = t || (this._fileMap = {}))[e];
|
|
79
|
-
return r || (r = t[e] = new
|
|
89
|
+
return r || (r = t[e] = new a(e, i, this), this.setChildTriggerNodes(r)),
|
|
80
90
|
r;
|
|
81
91
|
}
|
|
82
92
|
searchSubdir(i, t = i.length) {
|
|
@@ -97,34 +107,34 @@ class QyDir extends QyItem {
|
|
|
97
107
|
}
|
|
98
108
|
searchFile(e) {
|
|
99
109
|
var i = this.searchSubdir(e, e.length - 1);
|
|
100
|
-
if (i) return i.getFile(
|
|
110
|
+
if (i) return i.getFile(s(e));
|
|
101
111
|
}
|
|
102
112
|
searchOrCreateFile(e, i) {
|
|
103
|
-
return this.searchOrCreateSubdir(e, i, e.length - 1).getOrCreateFile(
|
|
113
|
+
return this.searchOrCreateSubdir(e, i, e.length - 1).getOrCreateFile(s(e));
|
|
104
114
|
}
|
|
105
115
|
get subdirList() {
|
|
106
|
-
return this
|
|
116
|
+
return h(this, "_subdirList", this.subdirMapChangeCount, () => this.created && this.subdirMap ? Object.values(this.subdirMap).filter(e => e.created) : []);
|
|
107
117
|
}
|
|
108
118
|
get subdirNameList() {
|
|
109
|
-
return this
|
|
119
|
+
return h(this, "_subdirNameList", this.subdirMapChangeCount, () => this.subdirList.map(e => e.name));
|
|
110
120
|
}
|
|
111
121
|
get sortedSubdirList() {
|
|
112
|
-
return this
|
|
122
|
+
return h(this, "_sortedSubdirList", this.subdirMapChangeCount, () => this.subdirList.sort((e, i) => e.cmp(i)));
|
|
113
123
|
}
|
|
114
124
|
get sortedSubdirNameList() {
|
|
115
|
-
return this
|
|
125
|
+
return h(this, "_sortedSubdirNameList", this.subdirMapChangeCount, () => this.sortedSubdirList.map(e => e.nameNum));
|
|
116
126
|
}
|
|
117
127
|
get fileList() {
|
|
118
|
-
return this
|
|
128
|
+
return h(this, "_fileList", this.fileMapChangeCount, () => this.created && this.fileMap ? Object.values(this.fileMap).filter(e => e.created) : []);
|
|
119
129
|
}
|
|
120
130
|
get fileNameList() {
|
|
121
|
-
return this
|
|
131
|
+
return h(this, "_fileNameList", this.fileMapChangeCount, () => this.fileList.map(e => e.name));
|
|
122
132
|
}
|
|
123
133
|
get sortedFileList() {
|
|
124
|
-
return this
|
|
134
|
+
return h(this, "_sortedFileList", this.fileMapChangeCount, () => this.fileList.sort((e, i) => e.cmp(i)));
|
|
125
135
|
}
|
|
126
136
|
get sortedFileNameList() {
|
|
127
|
-
return this
|
|
137
|
+
return h(this, "_sortedFileNameList", this.fileMapChangeCount, () => this.sortedFileList.map(e => e.nameNum));
|
|
128
138
|
}
|
|
129
139
|
*allSubdirs() {
|
|
130
140
|
var e, i, t = this.subdirList;
|
|
@@ -155,38 +165,64 @@ class QyDir extends QyItem {
|
|
|
155
165
|
e.triggerNodes = 0 < s.length ? s : void 0;
|
|
156
166
|
} else e.triggerNodes = void 0;
|
|
157
167
|
}
|
|
158
|
-
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
var
|
|
166
|
-
if (
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
168
|
+
*filterSubdirNames(e) {
|
|
169
|
+
for (var i of this.subdirList) e(i.name) && (yield i);
|
|
170
|
+
}
|
|
171
|
+
*compareSubdirRangeL2H(e) {
|
|
172
|
+
var i, t = this.sortedSubdirList;
|
|
173
|
+
let r = !1;
|
|
174
|
+
for (i of t) {
|
|
175
|
+
var s = i.nameNum;
|
|
176
|
+
if (isNaN(s)) {
|
|
177
|
+
if (r) return;
|
|
178
|
+
} else if (e(s)) yield i, r = !0; else if (r) return;
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
*compareSubdirRangeH2L(i) {
|
|
182
|
+
var t = this.sortedSubdirList;
|
|
183
|
+
let r = !1;
|
|
184
|
+
for (let e = t.length - 1; 0 <= e; --e) {
|
|
185
|
+
var s = t[e], a = s.nameNum;
|
|
186
|
+
if (isNaN(a)) {
|
|
187
|
+
if (r) return;
|
|
188
|
+
} else if (i(a)) yield s, r = !0; else if (r) return;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
function h(e, i, t, r) {
|
|
194
|
+
var e = e.cache, s = i + "ChangeCount";
|
|
195
|
+
return e[i] && e[s] == t || (e[i] = r(), e[s] = t), e[i];
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
function l(e) {
|
|
199
|
+
if (e.created && !e._subdirMap && !e.subdirMapLoaded) {
|
|
200
|
+
e.subdirMapLoaded = !0;
|
|
201
|
+
var i = e.qyCache;
|
|
202
|
+
if (i) {
|
|
203
|
+
i = i.qyKVData.getValueSync(e.subdirMapKey);
|
|
204
|
+
if (i) {
|
|
205
|
+
var t, r = e._subdirMap = {};
|
|
206
|
+
for (t in i) r[t] = new u(t, !0, e);
|
|
172
207
|
}
|
|
173
208
|
}
|
|
174
209
|
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function n(e) {
|
|
213
|
+
if (e.created && !e._fileMap && !e.fileMapLoaded) {
|
|
214
|
+
e.fileMapLoaded = !0;
|
|
215
|
+
var i = e.qyCache;
|
|
216
|
+
if (i) {
|
|
217
|
+
i = i.qyKVData.getValueSync(e.fileMapKey);
|
|
218
|
+
if (i) {
|
|
219
|
+
var t, r = e._fileMap = {};
|
|
220
|
+
for (t in i) r[t] = new a(t, !0, e);
|
|
185
221
|
}
|
|
186
222
|
}
|
|
187
223
|
}
|
|
188
224
|
}
|
|
189
225
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
226
|
+
export {
|
|
227
|
+
u as QyDir
|
|
228
|
+
};
|
package/src/QyFetch.js
CHANGED
|
@@ -1,38 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
QyCD as r
|
|
3
|
+
} from "./QyCD.js";
|
|
2
4
|
|
|
3
|
-
class
|
|
4
|
-
constructor(
|
|
5
|
-
super(
|
|
5
|
+
class e extends r {
|
|
6
|
+
constructor(r) {
|
|
7
|
+
super(r), Object.assign(this, {
|
|
6
8
|
stack: []
|
|
7
9
|
});
|
|
8
10
|
}
|
|
9
|
-
dir(
|
|
10
|
-
return this
|
|
11
|
+
dir(r, e) {
|
|
12
|
+
return u(this, super.dir(r, e));
|
|
11
13
|
}
|
|
12
|
-
indexDir(
|
|
13
|
-
return this
|
|
14
|
+
indexDir(r, e, s) {
|
|
15
|
+
return u(this, super.indexDir(r, e, s));
|
|
14
16
|
}
|
|
15
|
-
file(
|
|
16
|
-
return this
|
|
17
|
+
file(r, e) {
|
|
18
|
+
return u(this, super.file(r, e));
|
|
17
19
|
}
|
|
18
|
-
view(
|
|
19
|
-
return this
|
|
20
|
+
view(r, e, s) {
|
|
21
|
+
return u(this, super.view(r, e, s));
|
|
20
22
|
}
|
|
21
|
-
queryFiles(
|
|
22
|
-
return this
|
|
23
|
+
queryFiles(r, e, s, t, i) {
|
|
24
|
+
return u(this, super.queryFiles(r, e, s, t, i));
|
|
23
25
|
}
|
|
24
|
-
queryFilesMulti(
|
|
25
|
-
return this
|
|
26
|
+
queryFilesMulti(r, e, s, t) {
|
|
27
|
+
return u(this, super.queryFilesMulti(r, e, s, t));
|
|
26
28
|
}
|
|
27
29
|
run() {
|
|
28
|
-
var
|
|
29
|
-
return this.stack = [], this.resetCurrentDir(),
|
|
30
|
-
}
|
|
31
|
-
_push(s) {
|
|
32
|
-
return this.stack.push(s), this;
|
|
30
|
+
var r = this.stack;
|
|
31
|
+
return this.stack = [], this.resetCurrentDir(), r;
|
|
33
32
|
}
|
|
34
33
|
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
35
|
+
function u(r, e) {
|
|
36
|
+
return r.stack.push(e), r;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
e as QyFetch
|
|
41
|
+
};
|