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.
Files changed (82) hide show
  1. package/README.md +9 -3
  2. package/index.js +2 -3
  3. package/package.json +3 -2
  4. package/sample.js +37 -37
  5. package/scripts/airbnb.js +10 -11
  6. package/scripts/airbnb2.js +10 -11
  7. package/scripts/airbnb2_queries.js +11 -11
  8. package/scripts/airbnb_queries.js +15 -14
  9. package/scripts/downloadFile.js +29 -31
  10. package/scripts/express.js +5 -4
  11. package/scripts/fastify.js +12 -11
  12. package/scripts/flights.js +8 -8
  13. package/scripts/flights2.js +9 -9
  14. package/scripts/flights2_queries.js +19 -16
  15. package/scripts/flights_queries.js +18 -13
  16. package/src/QyAcl.js +153 -152
  17. package/src/QyAclSaver.js +16 -10
  18. package/src/QyAclSaver_Worker.js +21 -15
  19. package/src/QyAclWriter.js +23 -13
  20. package/src/QyBatch.js +298 -263
  21. package/src/QyBinWriter.js +49 -37
  22. package/src/QyCD.js +13 -14
  23. package/src/QyCache.js +177 -140
  24. package/src/QyCompressor.js +71 -45
  25. package/src/QyCompressor_Worker.js +17 -9
  26. package/src/QyDB.js +41 -12
  27. package/src/QyDefaultOptions.js +13 -10
  28. package/src/QyDir.js +89 -53
  29. package/src/QyFetch.js +27 -24
  30. package/src/QyFile.js +89 -77
  31. package/src/QyFileContentUtils.js +129 -132
  32. package/src/QyFileLogger.js +63 -41
  33. package/src/QyIndex.js +175 -197
  34. package/src/QyIndexPropTree.js +25 -25
  35. package/src/QyIntersectNode.js +34 -31
  36. package/src/QyItem.js +54 -52
  37. package/src/QyJsonSaver.js +12 -6
  38. package/src/QyKVData.js +279 -245
  39. package/src/QyKVDataCleaner.js +12 -6
  40. package/src/QyKVDataCleaner_Worker.js +77 -59
  41. package/src/QyKVDataLoader.js +67 -46
  42. package/src/QyKVDataSaver.js +15 -9
  43. package/src/QyKVDataSaver_Worker.js +83 -60
  44. package/src/QyLogFileSaver.js +12 -6
  45. package/src/QyLogFileSaver_Worker.js +24 -14
  46. package/src/QyLogger.js +51 -40
  47. package/src/QyMessageWorker.js +43 -29
  48. package/src/QyMessager.js +74 -54
  49. package/src/QyMessager_Run.js +20 -7
  50. package/src/QyMod.js +15 -11
  51. package/src/QyOpRunner.js +58 -41
  52. package/src/QyQueue.js +35 -30
  53. package/src/QySaver.js +52 -29
  54. package/src/QySnapshotCompactor.js +15 -9
  55. package/src/QySnapshotCompactor_Worker.js +131 -110
  56. package/src/QySnapshotSaver.js +15 -9
  57. package/src/QySnapshotSaver_Worker.js +125 -110
  58. package/src/QySnapshots.js +260 -241
  59. package/src/QyStructure.js +35 -27
  60. package/src/QyTrigger.js +62 -55
  61. package/src/QyUnionNode.js +54 -56
  62. package/src/QyUtils.js +170 -158
  63. package/src/QyWorker.js +34 -20
  64. package/src/hackernews.js +63 -71
  65. package/src/rpc/getFileContent.js +7 -7
  66. package/src/rpc/getSubItems.js +22 -22
  67. package/src/simulate.js +85 -80
  68. package/src/simulate2.js +77 -78
  69. package/src/soc_pokec.js +44 -32
  70. package/static/datafolderui/QyStyledElement.js +12 -12
  71. package/static/datafolderui/QyUIFolderTree.js +20 -20
  72. package/static/datafolderui/QyUIUtils.js +8 -8
  73. package/static/datafolderui/explore-tree.js +31 -31
  74. package/static/datafolderui/folder-tree.js +2 -2
  75. package/static/datafolderui/hscrpt.js +9 -17
  76. package/static/datafolderui/json-view.js +3 -5
  77. package/static/datafolderui/kv-input.js +15 -15
  78. package/static/datafolderui/list-input.js +17 -17
  79. package/static/datafolderui/main-page.js +18 -18
  80. package/static/datafolderui/num-input.js +5 -5
  81. package/static/datafolderui/querySelectorShadowRoot.js +15 -19
  82. package/static/datafolderui/resizable-input.js +18 -18
@@ -1,60 +1,86 @@
1
- let path = require("node:path"), pipeline = require("node:stream").pipeline, promisify = require("node:util").promisify, {
2
- createGzip,
3
- createUnzip
4
- } = require("node:zlib"), {
5
- createReadStream,
6
- createWriteStream
7
- } = require("node:fs"), fsPromises = require("node:fs/promises"), logger = require("./QyLogger.js").logger, {
8
- isNotNullObj,
9
- folderOrFileExists,
10
- ensureParentDir
11
- } = require("./QyUtils.js"), runOnceWithWorker = require("./QyWorker.js").runOnceWithWorker, pipe = promisify(pipeline), Zip_File_Extension = ".gz", compressorWorkerJsFileName = "QyCompressor_Worker.js";
12
-
13
- function compressFile(e, i, r) {
14
- return isNotNullObj(i) && (r = i, i = void 0), i = i || e + Zip_File_Extension,
15
- r = r || {}, e.endsWith(Zip_File_Extension) ? (logger.log(`${e} already ends with ${Zip_File_Extension}.`),
16
- !1) : i.endsWith(Zip_File_Extension) ? runOnceWithWorker(compressorWorkerJsFileName, {
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: i,
20
- options: r
21
- }).promise : (logger.log(`${i} doesn't end with ${Zip_File_Extension}.`), !1);
46
+ destFilePath: r,
47
+ options: o
48
+ }).promise : (d.log(r + " doesn't end with .gz."), !1);
22
49
  }
23
50
 
24
- function decompressFile(e, i, r) {
25
- return e.endsWith(Zip_File_Extension) ? (isNotNullObj(i) && (r = i, i = void 0),
26
- i = i || e.replace(new RegExp(Zip_File_Extension + "$"), ""), r = r || {}, path.extname(i) == Zip_File_Extension ? (logger.log(`${i} already ends with ${Zip_File_Extension}.`),
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: i,
31
- options: r
32
- }).promise) : (logger.log(`${e} doesn't end with ${Zip_File_Extension}.`), !1);
56
+ destFilePath: r,
57
+ options: o
58
+ }).promise) : (d.log(e + " doesn't end with .gz."), !1);
33
59
  }
34
60
 
35
- async function runOperation({
61
+ async function F({
36
62
  operation: e,
37
- srcFilePath: i,
38
- destFilePath: r,
39
- options: o
63
+ srcFilePath: r,
64
+ destFilePath: o,
65
+ options: i
40
66
  }) {
41
67
  var {
42
- removeSrcAfterSuccess: o,
43
- override: s
44
- } = o;
45
- if (!await folderOrFileExists(i)) throw new Error(i + " doesn't exist.");
46
- if (!s && await folderOrFileExists(r)) throw new Error(r + " already exists.");
47
- if (await ensureParentDir(r), await pipe(createReadStream(i), ("compress" == e ? createGzip : createUnzip)(), createWriteStream(r)),
48
- logger.info(e + `ed ${i} to ${r}.`), o) try {
49
- await fsPromises.unlink(i), logger.info("Unlinked " + i);
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
- logger.error(`Failed to unlink ${i}:`, e);
77
+ d.error(`Failed to unlink ${r}:`, e);
52
78
  }
53
79
  }
54
80
 
55
- Object.assign(module.exports, {
56
- Zip_File_Extension: Zip_File_Extension,
57
- compressFile: compressFile,
58
- decompressFile: decompressFile,
59
- runOperation: runOperation
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
- let {
2
- parentPort,
3
- getEnvironmentData,
4
- workerData
5
- } = require("node:worker_threads"), logger = require("./QyLogger.js").logger, runOperation = require("./QyCompressor.js").runOperation;
1
+ import {
2
+ parentPort as e,
3
+ getEnvironmentData as r,
4
+ workerData as o
5
+ } from "node:worker_threads";
6
6
 
7
- logger.level = getEnvironmentData("logLevel"), (async () => {
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 runOperation(workerData), parentPort.postMessage(!0);
10
- } catch (e) {
11
- parentPort.postMessage(e);
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
- let path = require("node:path"), QyFetch = require("./QyFetch.js").QyFetch, QyBatch = require("./QyBatch.js").QyBatch, QyCache = require("./QyCache.js").QyCache, getDefaultOptions = require("./QyDefaultOptions.js").getDefaultOptions, QyCD = require("./QyCD.js").QyCD, Default_RootFolder = path.join(__dirname, "../data/sampleDataFolder");
1
+ import {
2
+ join as e
3
+ } from "node:path";
2
4
 
3
- class QyDB extends QyCD {
4
- constructor(e = Default_RootFolder, t) {
5
- super(), Object.assign(this, {
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
- ...getDefaultOptions("QyDB"),
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 QyCache(this.rootFolder, e, this), Object.assign(this, {
47
+ }, t = new n(this.rootFolder, e, this), Object.assign(this, {
19
48
  qyCache: t,
20
- fetch: new QyFetch(t),
21
- batch: new QyBatch(t, e),
22
- _immediate: new QyBatch(t, e)
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
- Object.assign(module.exports, {
121
- QyDB: QyDB
122
- });
149
+ export {
150
+ h as QyDB
151
+ };
@@ -1,12 +1,14 @@
1
- let writerConfig = {
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
- }, Default_Options = {
8
- QyBaseWriter: writerConfig,
9
- QyBinWriter: writerConfig,
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 getDefaultOptions(e) {
54
- return e && Default_Options[e] || void 0;
56
+ function a(e) {
57
+ return e && t[e] || void 0;
55
58
  }
56
59
 
57
- Object.assign(module.exports, {
58
- getDefaultOptions: getDefaultOptions
59
- });
60
+ export {
61
+ a as getDefaultOptions
62
+ };
package/src/QyDir.js CHANGED
@@ -1,11 +1,21 @@
1
- let QyItem = require("./QyItem.js").QyItem, {
2
- getSubdirMapKey,
3
- getFileMapKey,
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
- class QyDir extends QyItem {
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._ensureFileMapLoaded(), this._fileCount;
39
+ return n(this), this._fileCount;
30
40
  }
31
41
  get subdirCount() {
32
- return this._ensureSubdirMapLoaded(), this._subdirCount;
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 == HiddenFolderName;
51
+ return this.name == d;
42
52
  }
43
53
  get subdirMapKey() {
44
- return this._subdirMapKey || (this._subdirMapKey = getSubdirMapKey(this.fullPathHash));
54
+ return this._subdirMapKey || (this._subdirMapKey = i(this.fullPathHash));
45
55
  }
46
56
  get fileMapKey() {
47
- return this._fileMapKey || (this._fileMapKey = getFileMapKey(this.fullPathHash));
57
+ return this._fileMapKey || (this._fileMapKey = t(this.fullPathHash));
48
58
  }
49
59
  get subdirMap() {
50
- return this._ensureSubdirMapLoaded(), this._subdirMap;
60
+ return l(this), this._subdirMap;
51
61
  }
52
62
  get fileMap() {
53
- return this._ensureFileMapLoaded(), this._fileMap;
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 QyDir(e, i, this), this.setChildTriggerNodes(r)),
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 QyFile(e, i, this), this.setChildTriggerNodes(r)),
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(arrayLast(e));
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(arrayLast(e));
113
+ return this.searchOrCreateSubdir(e, i, e.length - 1).getOrCreateFile(s(e));
104
114
  }
105
115
  get subdirList() {
106
- return this._getCachedValue("_subdirList", this.subdirMapChangeCount, () => this.created && this.subdirMap ? Object.values(this.subdirMap).filter(e => e.created) : []);
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._getCachedValue("_subdirNameList", this.subdirMapChangeCount, () => this.subdirList.map(e => e.name));
119
+ return h(this, "_subdirNameList", this.subdirMapChangeCount, () => this.subdirList.map(e => e.name));
110
120
  }
111
121
  get sortedSubdirList() {
112
- return this._getCachedValue("_sortedSubdirList", this.subdirMapChangeCount, () => this.subdirList.sort((e, i) => e.cmp(i)));
122
+ return h(this, "_sortedSubdirList", this.subdirMapChangeCount, () => this.subdirList.sort((e, i) => e.cmp(i)));
113
123
  }
114
124
  get sortedSubdirNameList() {
115
- return this._getCachedValue("_sortedSubdirNameList", this.subdirMapChangeCount, () => this.sortedSubdirList.map(e => e.nameNum));
125
+ return h(this, "_sortedSubdirNameList", this.subdirMapChangeCount, () => this.sortedSubdirList.map(e => e.nameNum));
116
126
  }
117
127
  get fileList() {
118
- return this._getCachedValue("_fileList", this.fileMapChangeCount, () => this.created && this.fileMap ? Object.values(this.fileMap).filter(e => e.created) : []);
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._getCachedValue("_fileNameList", this.fileMapChangeCount, () => this.fileList.map(e => e.name));
131
+ return h(this, "_fileNameList", this.fileMapChangeCount, () => this.fileList.map(e => e.name));
122
132
  }
123
133
  get sortedFileList() {
124
- return this._getCachedValue("_sortedFileList", this.fileMapChangeCount, () => this.fileList.sort((e, i) => e.cmp(i)));
134
+ return h(this, "_sortedFileList", this.fileMapChangeCount, () => this.fileList.sort((e, i) => e.cmp(i)));
125
135
  }
126
136
  get sortedFileNameList() {
127
- return this._getCachedValue("_sortedFileNameList", this.fileMapChangeCount, () => this.sortedFileList.map(e => e.nameNum));
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
- _getCachedValue(e, i, t) {
159
- var r = this.cache, s = e + "ChangeCount";
160
- return r[e] && r[s] == i || (r[e] = t(), r[s] = i), r[e];
161
- }
162
- _ensureSubdirMapLoaded() {
163
- if (this.created && !this._subdirMap && !this.subdirMapLoaded) {
164
- this.subdirMapLoaded = !0;
165
- var e = this.qyCache;
166
- if (e) {
167
- e = e.qyKVData.getValueSync(this.subdirMapKey);
168
- if (e) {
169
- var i, t = this._subdirMap = {};
170
- for (i in e) t[i] = new QyDir(i, !0, this);
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
- _ensureFileMapLoaded() {
176
- if (this.created && !this._fileMap && !this.fileMapLoaded) {
177
- this.fileMapLoaded = !0;
178
- var e = this.qyCache;
179
- if (e) {
180
- e = e.qyKVData.getValueSync(this.fileMapKey);
181
- if (e) {
182
- var i, t = this._fileMap = {};
183
- for (i in e) t[i] = new QyFile(i, !0, this);
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
- Object.assign(module.exports, {
191
- QyDir: QyDir
192
- });
226
+ export {
227
+ u as QyDir
228
+ };
package/src/QyFetch.js CHANGED
@@ -1,38 +1,41 @@
1
- let QyCD = require("./QyCD.js").QyCD;
1
+ import {
2
+ QyCD as r
3
+ } from "./QyCD.js";
2
4
 
3
- class QyFetch extends QyCD {
4
- constructor(s) {
5
- super(s), Object.assign(this, {
5
+ class e extends r {
6
+ constructor(r) {
7
+ super(r), Object.assign(this, {
6
8
  stack: []
7
9
  });
8
10
  }
9
- dir(s, e) {
10
- return this._push(super.dir(s, e));
11
+ dir(r, e) {
12
+ return u(this, super.dir(r, e));
11
13
  }
12
- indexDir(s, e, r) {
13
- return this._push(super.indexDir(s, e, r));
14
+ indexDir(r, e, s) {
15
+ return u(this, super.indexDir(r, e, s));
14
16
  }
15
- file(s, e) {
16
- return this._push(super.file(s, e));
17
+ file(r, e) {
18
+ return u(this, super.file(r, e));
17
19
  }
18
- view(s, e, r) {
19
- return this._push(super.view(s, e, r));
20
+ view(r, e, s) {
21
+ return u(this, super.view(r, e, s));
20
22
  }
21
- queryFiles(s, e, r, t, u) {
22
- return this._push(super.queryFiles(s, e, r, t, u));
23
+ queryFiles(r, e, s, t, i) {
24
+ return u(this, super.queryFiles(r, e, s, t, i));
23
25
  }
24
- queryFilesMulti(s, e, r, t) {
25
- return this._push(super.queryFilesMulti(s, e, r, t));
26
+ queryFilesMulti(r, e, s, t) {
27
+ return u(this, super.queryFilesMulti(r, e, s, t));
26
28
  }
27
29
  run() {
28
- var s = this.stack;
29
- return this.stack = [], this.resetCurrentDir(), s;
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
- Object.assign(module.exports, {
37
- QyFetch: QyFetch
38
- });
35
+ function u(r, e) {
36
+ return r.stack.push(e), r;
37
+ }
38
+
39
+ export {
40
+ e as QyFetch
41
+ };