datafolder 1.0.11 → 1.0.13
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 +16 -0
- package/package.json +1 -1
- package/scripts/airbnb.js +1 -1
- package/scripts/airbnb2.js +1 -1
- package/scripts/flights.js +2 -2
- package/scripts/flights2.js +4 -2
- package/src/QyAcl.d.ts +13 -7
- package/src/QyAcl.js +122 -138
- package/src/QyAclSaver.js +2 -2
- package/src/QyAclSaver_Worker.d.ts +2 -2
- package/src/QyBatch.d.ts +16 -12
- package/src/QyBatch.js +339 -228
- package/src/QyBinWriter.d.ts +1 -1
- package/src/QyBinWriter.js +15 -15
- package/src/QyCD.d.ts +2 -2
- package/src/QyCD.js +29 -29
- package/src/QyCache.d.ts +9 -1
- package/src/QyCache.js +110 -73
- package/src/QyCompressor.d.ts +2 -2
- package/src/QyCompressor.js +13 -13
- package/src/QyDB.d.ts +4 -22
- package/src/QyDB.js +49 -89
- package/src/QyDefaultOptions.js +2 -0
- package/src/QyDir.d.ts +1 -0
- package/src/QyDir.js +58 -30
- package/src/QyExpire.d.ts +15 -0
- package/src/QyExpire.js +105 -0
- package/src/QyExpireInfo.d.ts +10 -0
- package/src/QyExpireInfo.js +92 -0
- package/src/QyExpire_Worker.d.ts +19 -0
- package/src/QyExpire_Worker.js +112 -0
- package/src/QyFile.d.ts +1 -1
- package/src/QyFile.js +68 -42
- package/src/QyFileContentUtils.d.ts +1 -0
- package/src/QyFileContentUtils.js +108 -94
- package/src/QyItem.d.ts +7 -0
- package/src/QyItem.js +39 -15
- package/src/QyJsonSaver.d.ts +1 -1
- package/src/QyJsonSaver.js +1 -1
- package/src/QyKVData.d.ts +6 -1
- package/src/QyKVData.js +176 -157
- package/src/QyKVDataCleaner.js +2 -2
- package/src/QyKVDataSaver.js +2 -2
- package/src/QyKVDataSaver_Worker.d.ts +2 -2
- package/src/QyKVDataSaver_Worker.js +5 -5
- package/src/QyLogFileSaver.js +2 -2
- package/src/QyMessageWorker.d.ts +1 -1
- package/src/QyMessageWorker.js +10 -10
- package/src/QyMessager.d.ts +1 -1
- package/src/QyMessager.js +37 -36
- package/src/QyMessager_Run.js +9 -6
- package/src/QyQueue.js +8 -12
- package/src/QySaver.d.ts +1 -1
- package/src/QySaver.js +1 -1
- package/src/QySnapshotCompactor.js +2 -2
- package/src/QySnapshotCompactor_Worker.js +1 -1
- package/src/QySnapshotSaver.js +2 -2
- package/src/QySnapshotSaver_Worker.js +1 -1
- package/src/QyTrigger.d.ts +1 -1
- package/src/QyTrigger.js +20 -21
- package/src/QyUtils.d.ts +5 -2
- package/src/QyUtils.js +112 -98
- package/src/hackernews.js +1 -1
- package/src/simulate.js +6 -6
- package/src/simulate2.js +4 -4
- package/src/soc_pokec.js +1 -1
- package/static/codemirror.bundle/editor.bundle.js +49 -10
- package/static/datafolderui/QyUIFolderViewer.js +1 -5
- package/src/rpc/evalCode.js +0 -9
- package/src/rpc/getFileContent.js +0 -16
- package/src/rpc/getRpcFiles.js +0 -1
- package/src/rpc/getSubItems.js +0 -16
- package/src/rpc/getTriggerFiles.js +0 -1
- package/src/rpc/queryFiles.js +0 -10
- package/src/rpc/reloadRpc.js +0 -1
package/src/QyUtils.js
CHANGED
|
@@ -6,9 +6,9 @@ import e from "node:process";
|
|
|
6
6
|
|
|
7
7
|
import l from "node:fs/promises";
|
|
8
8
|
|
|
9
|
-
import
|
|
9
|
+
import i from "node:fs";
|
|
10
10
|
|
|
11
|
-
import
|
|
11
|
+
import o from "node:timers/promises";
|
|
12
12
|
|
|
13
13
|
import {
|
|
14
14
|
fileURLToPath as r
|
|
@@ -18,53 +18,53 @@ import {
|
|
|
18
18
|
logger as u
|
|
19
19
|
} from "../src/QyLogger.js";
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
let a = Array.isArray;
|
|
22
|
+
|
|
23
|
+
var f = t.dirname(r(import.meta.url)), c = Object.fromEntries([ "$del", "$link", "$rpl", "$spec", "$raw", "$all", "$clone", "$ext", "$or", "$and", "$gt", "$lt", "$gte", "$lte" ].map(r => [ r, r ])), s = "%", s = {
|
|
24
|
+
HiddenFolderName: s,
|
|
25
|
+
TriggerDirPath: [ s, "trigger" ],
|
|
26
|
+
RpcDirPath: [ s, "rpc" ],
|
|
27
|
+
IndexDirPath: [ s, "index" ],
|
|
28
|
+
ExpireDirPath: [ s, "expire" ],
|
|
29
|
+
MetaFilePath: [ s, "meta" ],
|
|
26
30
|
IndexPropPathsFileName: "propPaths"
|
|
27
31
|
};
|
|
28
32
|
|
|
29
|
-
function
|
|
33
|
+
function m(r) {
|
|
30
34
|
return r.startsWith("{") && r.endsWith("}");
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
function d(r) {
|
|
34
|
-
return
|
|
38
|
+
return m(r) && r.substring(1, r.length - 1);
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
function
|
|
41
|
+
function p(r) {
|
|
38
42
|
return 1e12 < r ? Math.round(100 * r / 1e12) / 100 + "TB" : 1e9 < r ? Math.round(100 * r / 1e9) / 100 + "GB" : 1e6 < r ? Math.round(100 * r / 1e6) / 100 + "MB" : 1e3 < r ? Math.round(100 * r / 1e3) / 100 + "KB" : r.toString();
|
|
39
43
|
}
|
|
40
44
|
|
|
41
|
-
function
|
|
45
|
+
function h(r, t = 10) {
|
|
42
46
|
return n.createHash("sha256").update(r, "utf8").digest("base64url").slice(0, t);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
var
|
|
49
|
+
var g = 11;
|
|
46
50
|
|
|
47
|
-
function
|
|
51
|
+
function y(r) {
|
|
48
52
|
return "d" + r;
|
|
49
53
|
}
|
|
50
54
|
|
|
51
|
-
function
|
|
55
|
+
function v(r) {
|
|
52
56
|
return "f" + r;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
function
|
|
59
|
+
function b(r) {
|
|
56
60
|
return "c" + r;
|
|
57
61
|
}
|
|
58
62
|
|
|
59
|
-
function
|
|
63
|
+
function w(r = 8) {
|
|
60
64
|
return n.randomBytes(r).toString("hex");
|
|
61
65
|
}
|
|
62
66
|
|
|
63
67
|
function $(r) {
|
|
64
|
-
return r[r.length - 1];
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function w(r) {
|
|
68
68
|
if (null != r) for (var t in r) if (null != r[t]) return !1;
|
|
69
69
|
return !0;
|
|
70
70
|
}
|
|
@@ -73,28 +73,28 @@ function P(r) {
|
|
|
73
73
|
return null != r && "object" == typeof r && !(r instanceof Date);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
function
|
|
76
|
+
function x(r) {
|
|
77
77
|
return "string" == typeof r;
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
function
|
|
80
|
+
function S(r) {
|
|
81
81
|
return "number" == typeof r;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
function
|
|
84
|
+
function j(r) {
|
|
85
85
|
return "boolean" == typeof r;
|
|
86
86
|
}
|
|
87
87
|
|
|
88
|
-
function
|
|
88
|
+
function M(r) {
|
|
89
89
|
return "function" == typeof r;
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
function
|
|
92
|
+
function B(r) {
|
|
93
93
|
var t = typeof r;
|
|
94
94
|
return "string" == t || "number" == t || "boolean" == t || r instanceof Date;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
function
|
|
97
|
+
function D(r) {
|
|
98
98
|
let t = r.length;
|
|
99
99
|
for (;null == r[t - 1] && 0 < t; ) --t;
|
|
100
100
|
return r.length = t, r;
|
|
@@ -107,25 +107,25 @@ function T(n) {
|
|
|
107
107
|
}))), n;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
-
function
|
|
110
|
+
function A(r) {
|
|
111
111
|
return Buffer.isBuffer(r) ? r : Buffer.from(r);
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
function
|
|
114
|
+
function E(r) {
|
|
115
115
|
return 1 < r ? "s" : "";
|
|
116
116
|
}
|
|
117
117
|
|
|
118
|
-
function
|
|
118
|
+
function F(r) {
|
|
119
119
|
return l.mkdir(r, {
|
|
120
120
|
recursive: !0
|
|
121
121
|
});
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
function
|
|
125
|
-
return
|
|
124
|
+
function O(r) {
|
|
125
|
+
return F(t.dirname(r));
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
async function
|
|
128
|
+
async function k(r) {
|
|
129
129
|
try {
|
|
130
130
|
return (await l.stat(r)).size;
|
|
131
131
|
} catch (r) {
|
|
@@ -134,29 +134,29 @@ async function I(r) {
|
|
|
134
134
|
}
|
|
135
135
|
|
|
136
136
|
async function W(r) {
|
|
137
|
-
return !1 !== await
|
|
137
|
+
return !1 !== await k(r);
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
function
|
|
140
|
+
function L(r, t = void 0) {
|
|
141
141
|
r *= 1e3;
|
|
142
|
-
return t ?
|
|
142
|
+
return t ? o.setTimeout(r, !0, {
|
|
143
143
|
signal: t
|
|
144
|
-
}) :
|
|
144
|
+
}) : o.setTimeout(r);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
let
|
|
147
|
+
let I;
|
|
148
148
|
|
|
149
|
-
async function
|
|
149
|
+
async function R(t) {
|
|
150
150
|
try {
|
|
151
|
-
await
|
|
151
|
+
await O(t);
|
|
152
152
|
var r = new Date().toISOString() + ": " + e.argv.join(" ");
|
|
153
153
|
function n() {
|
|
154
|
-
for (var r of Object.keys(
|
|
154
|
+
for (var r of Object.keys(I)) N(r);
|
|
155
155
|
}
|
|
156
156
|
await l.writeFile(t, r, {
|
|
157
157
|
flag: "wx",
|
|
158
158
|
flush: !0
|
|
159
|
-
}), u.info("Locked " + t),
|
|
159
|
+
}), u.info("Locked " + t), I ? I[t] = 1 : (I = {
|
|
160
160
|
[t]: 1
|
|
161
161
|
}, e.on("exit", n), e.on("SIGINT", n));
|
|
162
162
|
} catch (r) {
|
|
@@ -165,66 +165,70 @@ async function L(t) {
|
|
|
165
165
|
}
|
|
166
166
|
}
|
|
167
167
|
|
|
168
|
-
function
|
|
168
|
+
function N(r) {
|
|
169
169
|
try {
|
|
170
|
-
|
|
170
|
+
i.unlinkSync(r), u.info("Unlocked " + r);
|
|
171
171
|
} catch (r) {}
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
function
|
|
174
|
+
function G(r) {
|
|
175
175
|
return r.startsWith("[") && r.endsWith("]") ? JSON.parse(r) : r;
|
|
176
176
|
}
|
|
177
177
|
|
|
178
|
-
function
|
|
179
|
-
return
|
|
178
|
+
function H(r) {
|
|
179
|
+
return a(r) ? 1 == r.length ? r[0] : JSON.stringify(r) : r;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
|
-
function
|
|
182
|
+
function J(r) {
|
|
183
183
|
r = r.split("/");
|
|
184
184
|
return r[0] || (r[0] = "/"), r;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
|
-
function
|
|
187
|
+
function U(r) {
|
|
188
188
|
return r.split(".");
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
function Q(r) {
|
|
192
|
+
return x(r) ? [ U(r) ] : a(r) ? r.map(r => x(r) ? U(r) : r) : void 0;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function z(r) {
|
|
192
196
|
return r.join(".");
|
|
193
197
|
}
|
|
194
198
|
|
|
195
|
-
function
|
|
199
|
+
function K(r, t = 0) {
|
|
196
200
|
return Math.floor(Math.random() * (r - t)) + t;
|
|
197
201
|
}
|
|
198
202
|
|
|
199
|
-
function
|
|
203
|
+
function X(r) {
|
|
200
204
|
var t, n = {};
|
|
201
205
|
for (t of r) n[t] = 1;
|
|
202
206
|
return n;
|
|
203
207
|
}
|
|
204
208
|
|
|
205
|
-
async function
|
|
206
|
-
var
|
|
207
|
-
for (let r = 0; r <
|
|
208
|
-
var a = (await n.read(
|
|
209
|
+
async function q(t, n, e, i) {
|
|
210
|
+
var o = Buffer.allocUnsafe(i);
|
|
211
|
+
for (let r = 0; r < i; ) {
|
|
212
|
+
var a = (await n.read(o, r, i - r, e + r)).bytesRead;
|
|
209
213
|
if (0 == a) return void u.error(`read ${t} at ${e + r} returning 0 byte`);
|
|
210
214
|
r += a;
|
|
211
215
|
}
|
|
212
|
-
return
|
|
216
|
+
return o;
|
|
213
217
|
}
|
|
214
218
|
|
|
215
|
-
function
|
|
219
|
+
function C() {
|
|
216
220
|
var r = e.availableMemory();
|
|
217
221
|
return Math.round(r / (e.memoryUsage.rss() + r) * 100);
|
|
218
222
|
}
|
|
219
223
|
|
|
220
|
-
async function*
|
|
221
|
-
var n = e.length,
|
|
224
|
+
async function* V(e, t = 3) {
|
|
225
|
+
var n = e.length, i = (n < t && (t = n), new Array(n));
|
|
222
226
|
for (let r = 0; r < t; ++r) {
|
|
223
|
-
var
|
|
224
|
-
s(r,
|
|
227
|
+
var o = i[r] = {};
|
|
228
|
+
s(r, o);
|
|
225
229
|
}
|
|
226
230
|
for (let r = 0; r < n; ++r) {
|
|
227
|
-
var a =
|
|
231
|
+
var a = i[r % t], {
|
|
228
232
|
filePath: u,
|
|
229
233
|
bin: f
|
|
230
234
|
} = (a.bin || await a.promise, a), c = r + t;
|
|
@@ -243,48 +247,58 @@ async function* C(e, t = 3) {
|
|
|
243
247
|
}
|
|
244
248
|
}
|
|
245
249
|
|
|
250
|
+
function Y(r = new Date()) {
|
|
251
|
+
return r.getTime();
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
function Z(r = new Date()) {
|
|
255
|
+
r = r.getTime();
|
|
256
|
+
return r - r % 1e3;
|
|
257
|
+
}
|
|
258
|
+
|
|
246
259
|
export * as default from "./QyUtils.js";
|
|
247
260
|
|
|
248
261
|
export {
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
262
|
+
f as __dirname,
|
|
263
|
+
c as SpecialOperators,
|
|
264
|
+
s as SpecialFilePaths,
|
|
265
|
+
m as isMatchName,
|
|
253
266
|
d as getMatchParam,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
$ as
|
|
262
|
-
w as isEmptyObj,
|
|
267
|
+
p as getSizeStr,
|
|
268
|
+
h as calHash,
|
|
269
|
+
g as Hash_Key_Length,
|
|
270
|
+
y as getSubdirMapKey,
|
|
271
|
+
v as getFileMapKey,
|
|
272
|
+
b as getContentKey,
|
|
273
|
+
w as getRandomStr,
|
|
274
|
+
$ as isEmptyObj,
|
|
263
275
|
P as isNotNullObj,
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
276
|
+
x as isString,
|
|
277
|
+
S as isNumber,
|
|
278
|
+
j as isBoolean,
|
|
279
|
+
M as isFunction,
|
|
280
|
+
B as isSimpleType,
|
|
281
|
+
D as trimArrayTail,
|
|
270
282
|
T as setPromise,
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
283
|
+
A as toBuffer,
|
|
284
|
+
E as getSuffix,
|
|
285
|
+
F as ensureDir,
|
|
286
|
+
O as ensureParentDir,
|
|
287
|
+
k as getSize,
|
|
276
288
|
W as folderOrFileExists,
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
289
|
+
L as sleep,
|
|
290
|
+
R as lockExclusiveFilePath,
|
|
291
|
+
N as unlockExclusiveFilePath,
|
|
292
|
+
G as fromSingleName,
|
|
293
|
+
H as toSingleName,
|
|
294
|
+
J as pathSplit,
|
|
295
|
+
Q as ensurePropNamePathList,
|
|
296
|
+
z as propNameJoin,
|
|
297
|
+
K as randomInt,
|
|
298
|
+
X as listToMap,
|
|
299
|
+
q as readBufferAsync,
|
|
300
|
+
C as memoryPercent,
|
|
301
|
+
V as loadFileList,
|
|
302
|
+
Y as getNowTime,
|
|
303
|
+
Z as getNowRounded
|
|
290
304
|
};
|
package/src/hackernews.js
CHANGED
|
@@ -67,7 +67,7 @@ function c(e, t) {
|
|
|
67
67
|
let g = 0;
|
|
68
68
|
for (l in c) {
|
|
69
69
|
var w = a[l];
|
|
70
|
-
j.batch.insert([ "hackernews", ...w, l ], c[l]), ++g >= C && (j.batch.run(),
|
|
70
|
+
j.batch.insert([ "hackernews", ...w, l ], c[l], !0), ++g >= C && (j.batch.run(),
|
|
71
71
|
g = 0);
|
|
72
72
|
}
|
|
73
73
|
for (m in 0 < g && j.batch.run(), c) !function e(t) {
|
package/src/simulate.js
CHANGED
|
@@ -36,18 +36,18 @@ async function b(e) {
|
|
|
36
36
|
function h(e) {
|
|
37
37
|
console.time("insertData");
|
|
38
38
|
var t, s, r, o = e.batch;
|
|
39
|
-
for (t of d) o.insert([ "hosts", t ], p[t]);
|
|
39
|
+
for (t of d) o.insert([ "hosts", t ], p[t], !0);
|
|
40
40
|
for (s of g) {
|
|
41
41
|
var i = f[s], {
|
|
42
42
|
property_type: a,
|
|
43
43
|
room_type: n,
|
|
44
44
|
bed_type: l
|
|
45
45
|
} = i;
|
|
46
|
-
o.insert([ "airbnb", a, n, l, s ], i);
|
|
46
|
+
o.insert([ "airbnb", a, n, l, s ], i, !0);
|
|
47
47
|
}
|
|
48
48
|
for (r of y) {
|
|
49
49
|
var c = v[r];
|
|
50
|
-
o.insert([ "reviews", c.listing_id, r ], c);
|
|
50
|
+
o.insert([ "reviews", c.listing_id, r ], c, !0);
|
|
51
51
|
}
|
|
52
52
|
o.run(), console.timeEnd("insertData");
|
|
53
53
|
}
|
|
@@ -71,7 +71,7 @@ async function E(e, t) {
|
|
|
71
71
|
s = a = i = o = r = void 0;
|
|
72
72
|
var s, r = e, o = _(), i = _(), a = {};
|
|
73
73
|
for (s in i) 1 == u(2) && (a[s] = i[s]);
|
|
74
|
-
r.insert([ "hosts", o.host_id ], a);
|
|
74
|
+
r.insert([ "hosts", o.host_id ], a, !0);
|
|
75
75
|
break;
|
|
76
76
|
|
|
77
77
|
case 1:
|
|
@@ -84,14 +84,14 @@ async function E(e, t) {
|
|
|
84
84
|
bed_type: p,
|
|
85
85
|
_id: f
|
|
86
86
|
} = o;
|
|
87
|
-
r.insert([ "airbnb", o, m, p, f ], c);
|
|
87
|
+
r.insert([ "airbnb", o, m, p, f ], c, !0);
|
|
88
88
|
break;
|
|
89
89
|
|
|
90
90
|
case 2:
|
|
91
91
|
v = g = d = p = m = void 0;
|
|
92
92
|
var v, m = e, p = D(), d = D(), g = {};
|
|
93
93
|
for (v in d) 1 == u(2) && (g[v] = d[v]);
|
|
94
|
-
m.insert([ "reviews", p.listing_id, p._id ], g);
|
|
94
|
+
m.insert([ "reviews", p.listing_id, p._id ], g, !0);
|
|
95
95
|
}
|
|
96
96
|
await w(u(1e3) / 1e3);
|
|
97
97
|
}
|
package/src/simulate2.js
CHANGED
|
@@ -44,7 +44,7 @@ function w(t) {
|
|
|
44
44
|
Day: i
|
|
45
45
|
} = h[o], a = h[c(h.length)], n = {};
|
|
46
46
|
for (e in a) 1 == c(2) && (n[e] = a[e]);
|
|
47
|
-
t.insert([ "flights", s, r, i, o ], n);
|
|
47
|
+
t.insert([ "flights", s, r, i, o ], n, !0);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async function y(t, e) {
|
|
@@ -54,7 +54,7 @@ async function y(t, e) {
|
|
|
54
54
|
o = a = i = r = s = void 0;
|
|
55
55
|
var o, s = t, r = v()._key, i = v(), a = {};
|
|
56
56
|
for (o in i) 1 == c(2) && (a[o] = i[o]);
|
|
57
|
-
s.insert([ "airports", r ], a);
|
|
57
|
+
s.insert([ "airports", r ], a, !0);
|
|
58
58
|
break;
|
|
59
59
|
|
|
60
60
|
case 1:
|
|
@@ -68,7 +68,7 @@ function b(t) {
|
|
|
68
68
|
var e = t;
|
|
69
69
|
console.time("insertAirports");
|
|
70
70
|
var o, s = e.batch;
|
|
71
|
-
for (o of d) s.insert("airports/" + o._key, o);
|
|
71
|
+
for (o of d) s.insert("airports/" + o._key, o, !0);
|
|
72
72
|
s.run(), console.timeEnd("insertAirports");
|
|
73
73
|
e = t;
|
|
74
74
|
f.log("insertFlights begin"), console.time("insertFlights");
|
|
@@ -79,7 +79,7 @@ function b(t) {
|
|
|
79
79
|
Month: l,
|
|
80
80
|
Day: c
|
|
81
81
|
} = a;
|
|
82
|
-
i.insert(`flights/${n}/${l}/${c}/` + t, a);
|
|
82
|
+
i.insert(`flights/${n}/${l}/${c}/` + t, a, !0);
|
|
83
83
|
}
|
|
84
84
|
i.run(), f.log("insertFlights end"), console.timeEnd("insertFlights"), console.time("createFlightsIndex");
|
|
85
85
|
for (r of e.dir("flights").subdirList) for (var m of r.subdirList) for (var g of m.subdirList) i.createIndex(g, [ "_from", "_to" ]);
|
package/src/soc_pokec.js
CHANGED
|
@@ -50,7 +50,7 @@ let d = "./tmp/soc_pokec", w = new e(d);
|
|
|
50
50
|
let e = w.batch, t = 0;
|
|
51
51
|
for (a in r) {
|
|
52
52
|
var c = r[a];
|
|
53
|
-
e.insertP([ "relationships", a ], c), 3e4 < ++t && (await e.run(!0),
|
|
53
|
+
e.insertP([ "relationships", a ], c, !0), 3e4 < ++t && (await e.run(!0),
|
|
54
54
|
t = 0);
|
|
55
55
|
}
|
|
56
56
|
await e.run(!0), console.timeEnd("insertData"), s.close();
|
|
@@ -4315,6 +4315,7 @@
|
|
|
4315
4315
|
chrome_version: chrome ? +chrome[1] : 0,
|
|
4316
4316
|
ios,
|
|
4317
4317
|
android: /*@__PURE__*//Android\b/.test(nav.userAgent),
|
|
4318
|
+
webkit,
|
|
4318
4319
|
webkit_version: webkit ? +(/*@__PURE__*//\bAppleWebKit\/(\d+)/.exec(nav.userAgent) || [0, 0])[1] : 0,
|
|
4319
4320
|
safari,
|
|
4320
4321
|
safari_version: safari ? +(/*@__PURE__*//\bVersion\/(\d+(\.\d+)?)/.exec(nav.userAgent) || [0, 0])[1] : 0,
|
|
@@ -4833,12 +4834,12 @@
|
|
|
4833
4834
|
}
|
|
4834
4835
|
let moveX = 0, moveY = 0;
|
|
4835
4836
|
if (y == "nearest") {
|
|
4836
|
-
if (rect.top < bounding.top) {
|
|
4837
|
+
if (rect.top < bounding.top + yMargin) {
|
|
4837
4838
|
moveY = rect.top - (bounding.top + yMargin);
|
|
4838
4839
|
if (side > 0 && rect.bottom > bounding.bottom + moveY)
|
|
4839
4840
|
moveY = rect.bottom - bounding.bottom + yMargin;
|
|
4840
4841
|
}
|
|
4841
|
-
else if (rect.bottom > bounding.bottom) {
|
|
4842
|
+
else if (rect.bottom > bounding.bottom - yMargin) {
|
|
4842
4843
|
moveY = rect.bottom - bounding.bottom + yMargin;
|
|
4843
4844
|
if (side < 0 && (rect.top - moveY) < bounding.top)
|
|
4844
4845
|
moveY = rect.top - (bounding.top + yMargin);
|
|
@@ -4852,12 +4853,12 @@
|
|
|
4852
4853
|
moveY = targetTop - bounding.top;
|
|
4853
4854
|
}
|
|
4854
4855
|
if (x == "nearest") {
|
|
4855
|
-
if (rect.left < bounding.left) {
|
|
4856
|
+
if (rect.left < bounding.left + xMargin) {
|
|
4856
4857
|
moveX = rect.left - (bounding.left + xMargin);
|
|
4857
4858
|
if (side > 0 && rect.right > bounding.right + moveX)
|
|
4858
4859
|
moveX = rect.right - bounding.right + xMargin;
|
|
4859
4860
|
}
|
|
4860
|
-
else if (rect.right > bounding.right) {
|
|
4861
|
+
else if (rect.right > bounding.right - xMargin) {
|
|
4861
4862
|
moveX = rect.right - bounding.right + xMargin;
|
|
4862
4863
|
if (side < 0 && rect.left < bounding.left + moveX)
|
|
4863
4864
|
moveX = rect.left - (bounding.left + xMargin);
|
|
@@ -5597,7 +5598,7 @@
|
|
|
5597
5598
|
});
|
|
5598
5599
|
const scrollHandler = /*@__PURE__*/Facet.define();
|
|
5599
5600
|
class ScrollTarget {
|
|
5600
|
-
constructor(range, y
|
|
5601
|
+
constructor(range, y, x, yMargin, xMargin,
|
|
5601
5602
|
// This data structure is abused to also store precise scroll
|
|
5602
5603
|
// snapshots, instead of a `scrollIntoView` request. When this
|
|
5603
5604
|
// flag is `true`, `range` points at a position in the reference
|
|
@@ -8194,6 +8195,18 @@
|
|
|
8194
8195
|
this.y = (side.top + side.bottom) / 2;
|
|
8195
8196
|
return this.scan(positions, getRects);
|
|
8196
8197
|
}
|
|
8198
|
+
// Handle the case where closest matched a higher element on the
|
|
8199
|
+
// same line as an element below/above the coords
|
|
8200
|
+
if (closestDx) {
|
|
8201
|
+
if (above && above.bottom > closestRect.top) {
|
|
8202
|
+
this.y = above.bottom - 1;
|
|
8203
|
+
return this.scan(positions, getRects);
|
|
8204
|
+
}
|
|
8205
|
+
if (below && below.top < closestRect.bottom) {
|
|
8206
|
+
this.y = below.top + 1;
|
|
8207
|
+
return this.scan(positions, getRects);
|
|
8208
|
+
}
|
|
8209
|
+
}
|
|
8197
8210
|
let ltr = (bidi ? this.dirAt(positions[closestI], 1) : this.baseDir) == Direction.LTR;
|
|
8198
8211
|
return {
|
|
8199
8212
|
i: closestI,
|
|
@@ -12210,7 +12223,8 @@
|
|
|
12210
12223
|
scrollTarget = scrollTarget.map(tr.changes);
|
|
12211
12224
|
if (tr.scrollIntoView) {
|
|
12212
12225
|
let { main } = tr.state.selection;
|
|
12213
|
-
|
|
12226
|
+
let { x, y } = this.state.facet(EditorView.cursorScrollMargin);
|
|
12227
|
+
scrollTarget = new ScrollTarget(main.empty ? main : EditorSelection.cursor(main.head, main.head > main.anchor ? -1 : 1), "nearest", "nearest", y, x);
|
|
12214
12228
|
}
|
|
12215
12229
|
for (let e of tr.effects)
|
|
12216
12230
|
if (e.is(scrollIntoView$1))
|
|
@@ -12867,7 +12881,8 @@
|
|
|
12867
12881
|
cause it to scroll the given position or range into view.
|
|
12868
12882
|
*/
|
|
12869
12883
|
static scrollIntoView(pos, options = {}) {
|
|
12870
|
-
|
|
12884
|
+
var _a, _b, _c, _d;
|
|
12885
|
+
return scrollIntoView$1.of(new ScrollTarget(typeof pos == "number" ? EditorSelection.cursor(pos) : pos, (_a = options.y) !== null && _a !== void 0 ? _a : "nearest", (_b = options.x) !== null && _b !== void 0 ? _b : "nearest", (_c = options.yMargin) !== null && _c !== void 0 ? _c : 5, (_d = options.xMargin) !== null && _d !== void 0 ? _d : 5));
|
|
12871
12886
|
}
|
|
12872
12887
|
/**
|
|
12873
12888
|
Return an effect that resets the editor to its current (at the
|
|
@@ -13126,11 +13141,30 @@
|
|
|
13126
13141
|
*/
|
|
13127
13142
|
EditorView.bidiIsolatedRanges = bidiIsolatedRanges;
|
|
13128
13143
|
/**
|
|
13144
|
+
Can be used to specify the distance that scrolling cursor into
|
|
13145
|
+
view keeps it away from the sides of the editor, either as a
|
|
13146
|
+
single pixel number or two different values for the different
|
|
13147
|
+
axes. Defaults to 5 pixels on both axes.
|
|
13148
|
+
*/
|
|
13149
|
+
EditorView.cursorScrollMargin = /*@__PURE__*/Facet.define({
|
|
13150
|
+
combine: inputs => {
|
|
13151
|
+
let x = 5, y = 5;
|
|
13152
|
+
for (let i of inputs) {
|
|
13153
|
+
if (typeof i == "number")
|
|
13154
|
+
x = y = i;
|
|
13155
|
+
else
|
|
13156
|
+
({ x, y } = i);
|
|
13157
|
+
}
|
|
13158
|
+
return { x, y };
|
|
13159
|
+
}
|
|
13160
|
+
});
|
|
13161
|
+
/**
|
|
13129
13162
|
Facet that allows extensions to provide additional scroll
|
|
13130
13163
|
margins (space around the sides of the scrolling element that
|
|
13131
13164
|
should be considered invisible). This can be useful when the
|
|
13132
13165
|
plugin introduces elements that cover part of that element (for
|
|
13133
|
-
example a horizontally fixed gutter).
|
|
13166
|
+
example a horizontally fixed gutter). Not to be confused with
|
|
13167
|
+
[`cursorScrollMargin`](https://codemirror.net/6/docs/ref/#view.EditorView^cursorScrollMargin).
|
|
13134
13168
|
*/
|
|
13135
13169
|
EditorView.scrollMargins = scrollMargins;
|
|
13136
13170
|
/**
|
|
@@ -13666,7 +13700,7 @@
|
|
|
13666
13700
|
old = next;
|
|
13667
13701
|
}
|
|
13668
13702
|
this.drawn = markers;
|
|
13669
|
-
if (browser.
|
|
13703
|
+
if (browser.webkit) // Issue #1600, 1627, 1686
|
|
13670
13704
|
this.dom.style.display = this.dom.firstChild ? "" : "none";
|
|
13671
13705
|
}
|
|
13672
13706
|
}
|
|
@@ -25781,6 +25815,8 @@
|
|
|
25781
25815
|
if (dPrec)
|
|
25782
25816
|
this.score += dPrec;
|
|
25783
25817
|
if (depth == 0) {
|
|
25818
|
+
if (type < parser.minRepeatTerm && this.reducePos < this.pos)
|
|
25819
|
+
this.reducePos = this.pos;
|
|
25784
25820
|
this.pushState(parser.getGoto(this.state, type, true), this.reducePos);
|
|
25785
25821
|
// Zero-depth reductions are a special case—they add stuff to
|
|
25786
25822
|
// the stack without popping anything off.
|
|
@@ -25795,7 +25831,10 @@
|
|
|
25795
25831
|
// expression and the state that we'll be staying in, which should
|
|
25796
25832
|
// be moved to `this.state`).
|
|
25797
25833
|
let base = this.stack.length - ((depth - 1) * 3) - (action & 262144 /* Action.StayFlag */ ? 6 : 0);
|
|
25798
|
-
let start = base ? this.stack[base - 2] : this.p.ranges[0].from
|
|
25834
|
+
let start = base ? this.stack[base - 2] : this.p.ranges[0].from;
|
|
25835
|
+
if (type < parser.minRepeatTerm && start == this.reducePos && this.reducePos < this.pos)
|
|
25836
|
+
this.reducePos = this.pos;
|
|
25837
|
+
let size = this.reducePos - start;
|
|
25799
25838
|
// This is a kludge to try and detect overly deep left-associative
|
|
25800
25839
|
// trees, which will not increase the parse stack depth and thus
|
|
25801
25840
|
// won't be caught by the regular stack-depth limit check.
|
|
@@ -160,11 +160,7 @@ class t extends HTMLElement {
|
|
|
160
160
|
} = n = this;
|
|
161
161
|
i.hidden = !0, r.hidden = !1, e || n.codeMirrorDiv.append(e = n.code_mirror = c("code-mirror")),
|
|
162
162
|
t || n.codeMirrorDiv.append(t = n.code_mirror2 = c("code-mirror"));
|
|
163
|
-
var
|
|
164
|
-
fileNamePath: n,
|
|
165
|
-
propNamePathList: s,
|
|
166
|
-
modCode: l
|
|
167
|
-
} = s;
|
|
163
|
+
var [ n, s, l ] = s;
|
|
168
164
|
e.text = JSON.stringify({
|
|
169
165
|
fileNamePath: n,
|
|
170
166
|
propNamePathList: s
|
package/src/rpc/evalCode.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
let a = new Error("No such file");
|
|
2
|
-
|
|
3
|
-
module.exports = ({
|
|
4
|
-
filePath: e,
|
|
5
|
-
cChangeId: n
|
|
6
|
-
}) => {
|
|
7
|
-
var t, l, o, e = dataFolder.fileP(e);
|
|
8
|
-
return e ? ({
|
|
9
|
-
fileContent: e,
|
|
10
|
-
cChangeId: t,
|
|
11
|
-
fileContentKey: l
|
|
12
|
-
} = e, o = {}, n != t && (Object.assign(o, {
|
|
13
|
-
fileContent: e,
|
|
14
|
-
cChangeId: t
|
|
15
|
-
}), null == n) && (o.fileContentKey = l), o) : a;
|
|
16
|
-
};
|
package/src/rpc/getRpcFiles.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = () => dataFolder.fileListToTree(dataFolder.rpcFileList);
|