@wp-playground/storage 1.0.14 → 1.0.16
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/index.cjs +17 -17
- package/index.js +817 -792
- package/package.json +5 -5
package/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Semaphore as Lt, normalizePath as Mt, joinPaths as
|
|
2
|
-
import { Octokit as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { Semaphore as Lt, normalizePath as Mt, joinPaths as Ee } from "@php-wasm/util";
|
|
2
|
+
import { Octokit as Ie } from "octokit";
|
|
3
|
+
import _e from "crc-32";
|
|
4
|
+
import vt from "pako";
|
|
5
5
|
function jr(n) {
|
|
6
|
-
return new
|
|
6
|
+
return new Ie({
|
|
7
7
|
auth: n
|
|
8
8
|
});
|
|
9
9
|
}
|
|
@@ -14,15 +14,15 @@ function Lr(n, r = "") {
|
|
|
14
14
|
s.path.startsWith(r) && (o[s.path.substring(r.length)] = s.content);
|
|
15
15
|
return o;
|
|
16
16
|
}
|
|
17
|
-
async function
|
|
18
|
-
|
|
17
|
+
async function Ae(n, r, o, s, u, f = {}) {
|
|
18
|
+
f.progress || (f.progress = {
|
|
19
19
|
foundFiles: 0,
|
|
20
20
|
downloadedFiles: 0
|
|
21
21
|
});
|
|
22
|
-
const { onProgress: h } =
|
|
22
|
+
const { onProgress: h } = f, a = [], w = [], { data: y } = await n.rest.repos.getContent({
|
|
23
23
|
owner: r,
|
|
24
24
|
repo: o,
|
|
25
|
-
path:
|
|
25
|
+
path: u,
|
|
26
26
|
ref: s
|
|
27
27
|
});
|
|
28
28
|
if (!Array.isArray(y))
|
|
@@ -30,65 +30,65 @@ async function Fe(n, r, o, s, f, u = {}) {
|
|
|
30
30
|
`Expected the list of files to be an array, but got ${typeof y}`
|
|
31
31
|
);
|
|
32
32
|
for (const b of y)
|
|
33
|
-
b.type === "file" ? (++
|
|
34
|
-
|
|
33
|
+
b.type === "file" ? (++f.progress.foundFiles, h == null || h(f.progress), a.push(
|
|
34
|
+
Ue(n, r, o, s, b).then((B) => (++f.progress.downloadedFiles, h == null || h(f.progress), B))
|
|
35
35
|
)) : b.type === "dir" && w.push(
|
|
36
|
-
|
|
36
|
+
Ae(
|
|
37
37
|
n,
|
|
38
38
|
r,
|
|
39
39
|
o,
|
|
40
40
|
s,
|
|
41
41
|
b.path,
|
|
42
|
-
|
|
42
|
+
f
|
|
43
43
|
)
|
|
44
44
|
);
|
|
45
|
-
const g = await Promise.all(
|
|
45
|
+
const g = await Promise.all(a), m = (await Promise.all(w)).flatMap(
|
|
46
46
|
(b) => b
|
|
47
47
|
);
|
|
48
48
|
return [...g, ...m];
|
|
49
49
|
}
|
|
50
|
-
const
|
|
51
|
-
async function
|
|
52
|
-
const
|
|
50
|
+
const Fe = new Lt({ concurrency: 15 });
|
|
51
|
+
async function Ue(n, r, o, s, u) {
|
|
52
|
+
const f = await Fe.acquire();
|
|
53
53
|
try {
|
|
54
54
|
const { data: h } = await n.rest.repos.getContent({
|
|
55
55
|
owner: r,
|
|
56
56
|
repo: o,
|
|
57
57
|
ref: s,
|
|
58
|
-
path:
|
|
58
|
+
path: u.path
|
|
59
59
|
});
|
|
60
60
|
if (!("content" in h))
|
|
61
|
-
throw new Error(`No content found for ${
|
|
61
|
+
throw new Error(`No content found for ${u.path}`);
|
|
62
62
|
return {
|
|
63
|
-
name:
|
|
64
|
-
path:
|
|
65
|
-
content:
|
|
63
|
+
name: u.name,
|
|
64
|
+
path: u.path,
|
|
65
|
+
content: Se(h.content)
|
|
66
66
|
};
|
|
67
67
|
} finally {
|
|
68
|
-
|
|
68
|
+
f();
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function Se(n) {
|
|
72
72
|
const r = window.atob(n), o = r.length, s = new Uint8Array(o);
|
|
73
|
-
for (let
|
|
74
|
-
s[
|
|
73
|
+
for (let u = 0; u < o; u++)
|
|
74
|
+
s[u] = r.charCodeAt(u);
|
|
75
75
|
return s;
|
|
76
76
|
}
|
|
77
|
-
async function Mr(n, r, o, s,
|
|
77
|
+
async function Mr(n, r, o, s, u) {
|
|
78
78
|
var g;
|
|
79
|
-
const { data:
|
|
79
|
+
const { data: f } = await n.rest.pulls.get({
|
|
80
80
|
owner: r,
|
|
81
81
|
repo: o,
|
|
82
82
|
pull_number: s
|
|
83
|
-
}),
|
|
83
|
+
}), a = (g = (await n.rest.actions.listWorkflowRuns({
|
|
84
84
|
owner: r,
|
|
85
85
|
repo: o,
|
|
86
|
-
branch:
|
|
87
|
-
workflow_id:
|
|
86
|
+
branch: f.head.ref,
|
|
87
|
+
workflow_id: u
|
|
88
88
|
})).data.workflow_runs[0]) == null ? void 0 : g.id, w = await n.rest.actions.listWorkflowRunArtifacts({
|
|
89
89
|
owner: r,
|
|
90
90
|
repo: o,
|
|
91
|
-
run_id:
|
|
91
|
+
run_id: a
|
|
92
92
|
});
|
|
93
93
|
return (await n.rest.actions.downloadArtifact({
|
|
94
94
|
owner: r,
|
|
@@ -97,18 +97,18 @@ async function Mr(n, r, o, s, f) {
|
|
|
97
97
|
archive_format: "zip"
|
|
98
98
|
})).data;
|
|
99
99
|
}
|
|
100
|
-
async function
|
|
101
|
-
var
|
|
102
|
-
const { data: s, headers:
|
|
100
|
+
async function vr(n, r, o) {
|
|
101
|
+
var f;
|
|
102
|
+
const { data: s, headers: u } = await n.request(
|
|
103
103
|
"GET /repos/{owner}/{repo}",
|
|
104
104
|
{
|
|
105
105
|
owner: r,
|
|
106
106
|
repo: o
|
|
107
107
|
}
|
|
108
108
|
);
|
|
109
|
-
return !(!
|
|
109
|
+
return !(!u["x-oauth-scopes"] || !((f = s.permissions) != null && f.push));
|
|
110
110
|
}
|
|
111
|
-
async function
|
|
111
|
+
async function Gr(n, r, o, s, u) {
|
|
112
112
|
await n.request("GET /repos/{owner}/{repo}/branches/{branch}", {
|
|
113
113
|
owner: r,
|
|
114
114
|
repo: o,
|
|
@@ -119,16 +119,16 @@ async function Hr(n, r, o, s, f) {
|
|
|
119
119
|
) ? await n.request("PATCH /repos/{owner}/{repo}/git/refs/{ref}", {
|
|
120
120
|
owner: r,
|
|
121
121
|
repo: o,
|
|
122
|
-
sha:
|
|
122
|
+
sha: u,
|
|
123
123
|
ref: `heads/${s}`
|
|
124
124
|
}) : await n.request("POST /repos/{owner}/{repo}/git/refs", {
|
|
125
125
|
owner: r,
|
|
126
126
|
repo: o,
|
|
127
|
-
sha:
|
|
127
|
+
sha: u,
|
|
128
128
|
ref: `refs/heads/${s}`
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
|
-
async function
|
|
131
|
+
async function Hr(n, r, o) {
|
|
132
132
|
const s = await n.request("GET /user");
|
|
133
133
|
return (await n.request("GET /repos/{owner}/{repo}/forks", {
|
|
134
134
|
owner: r,
|
|
@@ -140,27 +140,27 @@ async function qr(n, r, o) {
|
|
|
140
140
|
repo: o
|
|
141
141
|
}), s.data.login;
|
|
142
142
|
}
|
|
143
|
-
async function
|
|
143
|
+
async function qr(n, r, o, s, u, f) {
|
|
144
144
|
const {
|
|
145
145
|
data: { sha: h }
|
|
146
146
|
} = await n.request("POST /repos/{owner}/{repo}/git/commits", {
|
|
147
147
|
owner: r,
|
|
148
148
|
repo: o,
|
|
149
149
|
message: s,
|
|
150
|
-
tree:
|
|
151
|
-
parents: [
|
|
150
|
+
tree: f,
|
|
151
|
+
parents: [u]
|
|
152
152
|
});
|
|
153
153
|
return h;
|
|
154
154
|
}
|
|
155
|
-
async function zr(n, r, o, s,
|
|
156
|
-
const
|
|
155
|
+
async function zr(n, r, o, s, u) {
|
|
156
|
+
const f = await ke(
|
|
157
157
|
n,
|
|
158
158
|
r,
|
|
159
159
|
o,
|
|
160
160
|
s,
|
|
161
|
-
|
|
161
|
+
u
|
|
162
162
|
);
|
|
163
|
-
if (
|
|
163
|
+
if (f.length === 0)
|
|
164
164
|
return null;
|
|
165
165
|
const {
|
|
166
166
|
data: { sha: h }
|
|
@@ -168,31 +168,31 @@ async function zr(n, r, o, s, f) {
|
|
|
168
168
|
owner: r,
|
|
169
169
|
repo: o,
|
|
170
170
|
base_tree: s,
|
|
171
|
-
tree:
|
|
171
|
+
tree: f
|
|
172
172
|
});
|
|
173
173
|
return h;
|
|
174
174
|
}
|
|
175
|
-
async function
|
|
176
|
-
const
|
|
177
|
-
for (const [h,
|
|
178
|
-
|
|
179
|
-
for (const [h,
|
|
180
|
-
|
|
181
|
-
for (const h of
|
|
182
|
-
|
|
183
|
-
return Promise.all(
|
|
184
|
-
(h) => h.filter((
|
|
175
|
+
async function ke(n, r, o, s, u) {
|
|
176
|
+
const f = [];
|
|
177
|
+
for (const [h, a] of u.create)
|
|
178
|
+
f.push(Ct(n, r, o, h, a));
|
|
179
|
+
for (const [h, a] of u.update)
|
|
180
|
+
f.push(Ct(n, r, o, h, a));
|
|
181
|
+
for (const h of u.delete)
|
|
182
|
+
f.push(Te(n, r, o, s, h));
|
|
183
|
+
return Promise.all(f).then(
|
|
184
|
+
(h) => h.filter((a) => !!a)
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
|
-
const
|
|
188
|
-
async function Ct(n, r, o, s,
|
|
189
|
-
const
|
|
187
|
+
const Gt = new Lt({ concurrency: 10 });
|
|
188
|
+
async function Ct(n, r, o, s, u) {
|
|
189
|
+
const f = await Gt.acquire();
|
|
190
190
|
try {
|
|
191
|
-
if (ArrayBuffer.isView(
|
|
191
|
+
if (ArrayBuffer.isView(u))
|
|
192
192
|
try {
|
|
193
193
|
const h = new TextDecoder("utf-8", {
|
|
194
194
|
fatal: !0
|
|
195
|
-
}).decode(
|
|
195
|
+
}).decode(u);
|
|
196
196
|
return {
|
|
197
197
|
path: s,
|
|
198
198
|
content: h,
|
|
@@ -200,49 +200,49 @@ async function Ct(n, r, o, s, f) {
|
|
|
200
200
|
};
|
|
201
201
|
} catch {
|
|
202
202
|
const {
|
|
203
|
-
data: { sha:
|
|
203
|
+
data: { sha: a }
|
|
204
204
|
} = await n.rest.git.createBlob({
|
|
205
205
|
owner: r,
|
|
206
206
|
repo: o,
|
|
207
207
|
encoding: "base64",
|
|
208
|
-
content:
|
|
208
|
+
content: $e(u)
|
|
209
209
|
});
|
|
210
210
|
return {
|
|
211
211
|
path: s,
|
|
212
|
-
sha:
|
|
212
|
+
sha: a,
|
|
213
213
|
mode: "100644"
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
216
|
else
|
|
217
217
|
return {
|
|
218
218
|
path: s,
|
|
219
|
-
content:
|
|
219
|
+
content: u,
|
|
220
220
|
mode: "100644"
|
|
221
221
|
};
|
|
222
222
|
} finally {
|
|
223
|
-
|
|
223
|
+
f();
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
|
-
async function
|
|
227
|
-
const
|
|
226
|
+
async function Te(n, r, o, s, u) {
|
|
227
|
+
const f = await Gt.acquire();
|
|
228
228
|
try {
|
|
229
229
|
return await n.request("HEAD /repos/{owner}/{repo}/contents/:path", {
|
|
230
230
|
owner: r,
|
|
231
231
|
repo: o,
|
|
232
232
|
ref: s,
|
|
233
|
-
path:
|
|
233
|
+
path: u
|
|
234
234
|
}), {
|
|
235
|
-
path:
|
|
235
|
+
path: u,
|
|
236
236
|
mode: "100644",
|
|
237
237
|
sha: null
|
|
238
238
|
};
|
|
239
239
|
} catch {
|
|
240
240
|
return;
|
|
241
241
|
} finally {
|
|
242
|
-
|
|
242
|
+
f();
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
|
-
function
|
|
245
|
+
function $e(n) {
|
|
246
246
|
const r = [], o = n.byteLength;
|
|
247
247
|
for (let s = 0; s < o; s++)
|
|
248
248
|
r.push(String.fromCharCode(n[s]));
|
|
@@ -258,15 +258,15 @@ async function* Wr(n, r, { exceptPaths: o = [] } = {}) {
|
|
|
258
258
|
}
|
|
259
259
|
const s = [r];
|
|
260
260
|
for (; s.length; ) {
|
|
261
|
-
const
|
|
262
|
-
if (!
|
|
261
|
+
const u = s.pop();
|
|
262
|
+
if (!u)
|
|
263
263
|
return;
|
|
264
|
-
const
|
|
265
|
-
for (const h of
|
|
266
|
-
const
|
|
267
|
-
o.includes(
|
|
268
|
-
path:
|
|
269
|
-
read: async () => await n.readFileAsBuffer(
|
|
264
|
+
const f = await n.listFiles(u);
|
|
265
|
+
for (const h of f) {
|
|
266
|
+
const a = Ee(u, h);
|
|
267
|
+
o.includes(a.substring(r.length + 1)) || (await n.isDir(a) ? s.push(a) : yield {
|
|
268
|
+
path: a,
|
|
269
|
+
read: async () => await n.readFileAsBuffer(a)
|
|
270
270
|
});
|
|
271
271
|
}
|
|
272
272
|
}
|
|
@@ -277,22 +277,22 @@ async function Yr(n, r) {
|
|
|
277
277
|
update: /* @__PURE__ */ new Map(),
|
|
278
278
|
delete: /* @__PURE__ */ new Set()
|
|
279
279
|
}, s = /* @__PURE__ */ new Set();
|
|
280
|
-
for await (const
|
|
281
|
-
s.add(
|
|
282
|
-
const
|
|
283
|
-
|
|
280
|
+
for await (const u of r) {
|
|
281
|
+
s.add(u.path);
|
|
282
|
+
const f = n.get(u.path), h = await u.read();
|
|
283
|
+
f ? Re(f, h) || o.update.set(u.path, h) : o.create.set(u.path, h);
|
|
284
284
|
}
|
|
285
|
-
for (const
|
|
286
|
-
s.has(
|
|
285
|
+
for (const u of n.keys())
|
|
286
|
+
s.has(u) || o.delete.add(u);
|
|
287
287
|
return o;
|
|
288
288
|
}
|
|
289
|
-
function
|
|
289
|
+
function Re(n, r) {
|
|
290
290
|
return n.length === r.length && n.every((o, s) => o === r[s]);
|
|
291
291
|
}
|
|
292
|
-
async function
|
|
293
|
-
return n.type === "local-fs" ? n.handle :
|
|
292
|
+
async function Ce(n) {
|
|
293
|
+
return n.type === "local-fs" ? n.handle : Oe(n.path);
|
|
294
294
|
}
|
|
295
|
-
async function
|
|
295
|
+
async function Oe(n) {
|
|
296
296
|
const r = n.split("/").filter((s) => s.length > 0);
|
|
297
297
|
let o = await navigator.storage.getDirectory();
|
|
298
298
|
for (const s of r)
|
|
@@ -309,13 +309,13 @@ async function Vr(n) {
|
|
|
309
309
|
return "/" + o.join("/");
|
|
310
310
|
}
|
|
311
311
|
async function Kr(n) {
|
|
312
|
-
const r = await
|
|
312
|
+
const r = await Ce(n);
|
|
313
313
|
for await (const o of r.keys())
|
|
314
314
|
await r.removeEntry(o, {
|
|
315
315
|
recursive: !0
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Pe(n) {
|
|
319
319
|
let r = [n];
|
|
320
320
|
return {
|
|
321
321
|
next() {
|
|
@@ -329,14 +329,14 @@ function De(n) {
|
|
|
329
329
|
}
|
|
330
330
|
};
|
|
331
331
|
}
|
|
332
|
-
function
|
|
333
|
-
return n[Symbol.asyncIterator] ? n[Symbol.asyncIterator]() : n[Symbol.iterator] ? n[Symbol.iterator]() : n.next ? n :
|
|
332
|
+
function Ht(n) {
|
|
333
|
+
return n[Symbol.asyncIterator] ? n[Symbol.asyncIterator]() : n[Symbol.iterator] ? n[Symbol.iterator]() : n.next ? n : Pe(n);
|
|
334
334
|
}
|
|
335
|
-
class
|
|
335
|
+
class qt {
|
|
336
336
|
constructor(r) {
|
|
337
337
|
if (typeof Buffer > "u")
|
|
338
338
|
throw new Error("Missing Buffer dependency");
|
|
339
|
-
this.stream =
|
|
339
|
+
this.stream = Ht(r), this.buffer = null, this.cursor = 0, this.undoCursor = 0, this.started = !1, this._ended = !1, this._discardedBytes = 0;
|
|
340
340
|
}
|
|
341
341
|
eof() {
|
|
342
342
|
return this._ended && this.cursor === this.buffer.length;
|
|
@@ -395,7 +395,7 @@ class vt {
|
|
|
395
395
|
function Ne(n) {
|
|
396
396
|
return n.reduce((r, o) => r + o.length, 0);
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function De(n, r) {
|
|
399
399
|
const o = r.toString(16);
|
|
400
400
|
return "0".repeat(n - o.length) + o;
|
|
401
401
|
}
|
|
@@ -408,22 +408,22 @@ class k {
|
|
|
408
408
|
}
|
|
409
409
|
static encode(r) {
|
|
410
410
|
typeof r == "string" && (r = Buffer.from(r));
|
|
411
|
-
const o = r.length + 4, s =
|
|
411
|
+
const o = r.length + 4, s = De(4, o);
|
|
412
412
|
return Buffer.concat([Buffer.from(s, "utf8"), r]);
|
|
413
413
|
}
|
|
414
414
|
static streamReader(r) {
|
|
415
|
-
const o = new
|
|
415
|
+
const o = new qt(r);
|
|
416
416
|
return async function() {
|
|
417
417
|
try {
|
|
418
|
-
let
|
|
419
|
-
if (
|
|
418
|
+
let u = await o.read(4);
|
|
419
|
+
if (u == null)
|
|
420
420
|
return !0;
|
|
421
|
-
if (
|
|
421
|
+
if (u = parseInt(u.toString("utf8"), 16), u === 0 || u === 1)
|
|
422
422
|
return null;
|
|
423
|
-
const
|
|
424
|
-
return
|
|
425
|
-
} catch (
|
|
426
|
-
return r.error =
|
|
423
|
+
const f = await o.read(u - 4);
|
|
424
|
+
return f ?? !0;
|
|
425
|
+
} catch (u) {
|
|
426
|
+
return r.error = u, !0;
|
|
427
427
|
}
|
|
428
428
|
};
|
|
429
429
|
}
|
|
@@ -472,10 +472,10 @@ ot.code = "UnsafeFilepathError";
|
|
|
472
472
|
function zt(n, r) {
|
|
473
473
|
return -(n < r) || +(n > r);
|
|
474
474
|
}
|
|
475
|
-
function
|
|
475
|
+
function je(n, r) {
|
|
476
476
|
return zt(n.path, r.path);
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function Le(n, r) {
|
|
479
479
|
return zt(Ot(n), Ot(r));
|
|
480
480
|
}
|
|
481
481
|
function Ot(n) {
|
|
@@ -496,7 +496,7 @@ function Wt(n) {
|
|
|
496
496
|
}
|
|
497
497
|
throw new _(`Unexpected GitTree entry mode: ${n}`);
|
|
498
498
|
}
|
|
499
|
-
function
|
|
499
|
+
function Me(n) {
|
|
500
500
|
const r = [];
|
|
501
501
|
let o = 0;
|
|
502
502
|
for (; o < n.length; ) {
|
|
@@ -505,22 +505,22 @@ function Ge(n) {
|
|
|
505
505
|
throw new _(
|
|
506
506
|
`GitTree: Error parsing buffer at byte location ${o}: Could not find the next space character.`
|
|
507
507
|
);
|
|
508
|
-
const
|
|
509
|
-
if (
|
|
508
|
+
const u = n.indexOf(0, o);
|
|
509
|
+
if (u === -1)
|
|
510
510
|
throw new _(
|
|
511
511
|
`GitTree: Error parsing buffer at byte location ${o}: Could not find the next null character.`
|
|
512
512
|
);
|
|
513
|
-
let
|
|
514
|
-
|
|
515
|
-
const h = Wt(
|
|
516
|
-
if (
|
|
517
|
-
throw new ot(
|
|
518
|
-
const w = n.slice(
|
|
519
|
-
o =
|
|
513
|
+
let f = n.slice(o, s).toString("utf8");
|
|
514
|
+
f === "40000" && (f = "040000");
|
|
515
|
+
const h = Wt(f), a = n.slice(s + 1, u).toString("utf8");
|
|
516
|
+
if (a.includes("\\") || a.includes("/"))
|
|
517
|
+
throw new ot(a);
|
|
518
|
+
const w = n.slice(u + 1, u + 21).toString("hex");
|
|
519
|
+
o = u + 21, r.push({ mode: f, path: a, oid: w, type: h });
|
|
520
520
|
}
|
|
521
521
|
return r;
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function ve(n) {
|
|
524
524
|
if (typeof n == "number" && (n = n.toString(8)), n.match(/^0?4.*/))
|
|
525
525
|
return "040000";
|
|
526
526
|
if (n.match(/^1006.*/))
|
|
@@ -533,18 +533,18 @@ function He(n) {
|
|
|
533
533
|
return "160000";
|
|
534
534
|
throw new _(`Could not understand file mode: ${n}`);
|
|
535
535
|
}
|
|
536
|
-
function
|
|
537
|
-
return !n.oid && n.sha && (n.oid = n.sha), n.mode =
|
|
536
|
+
function Ge(n) {
|
|
537
|
+
return !n.oid && n.sha && (n.oid = n.sha), n.mode = ve(n.mode), n.type || (n.type = Wt(n.mode)), n;
|
|
538
538
|
}
|
|
539
539
|
class bt {
|
|
540
540
|
constructor(r) {
|
|
541
541
|
if (Buffer.isBuffer(r))
|
|
542
|
-
this._entries =
|
|
542
|
+
this._entries = Me(r);
|
|
543
543
|
else if (Array.isArray(r))
|
|
544
|
-
this._entries = r.map(
|
|
544
|
+
this._entries = r.map(Ge);
|
|
545
545
|
else
|
|
546
546
|
throw new _("invalid type passed to GitTree constructor");
|
|
547
|
-
this._entries.sort(
|
|
547
|
+
this._entries.sort(je);
|
|
548
548
|
}
|
|
549
549
|
static from(r) {
|
|
550
550
|
return new bt(r);
|
|
@@ -555,10 +555,10 @@ class bt {
|
|
|
555
555
|
}
|
|
556
556
|
toObject() {
|
|
557
557
|
const r = [...this._entries];
|
|
558
|
-
return r.sort(
|
|
558
|
+
return r.sort(Le), Buffer.concat(
|
|
559
559
|
r.map((o) => {
|
|
560
|
-
const s = Buffer.from(o.mode.replace(/^0/, "")),
|
|
561
|
-
return Buffer.concat([s,
|
|
560
|
+
const s = Buffer.from(o.mode.replace(/^0/, "")), u = Buffer.from(" "), f = Buffer.from(o.path, "utf8"), h = Buffer.from([0]), a = Buffer.from(o.oid, "hex");
|
|
561
|
+
return Buffer.concat([s, u, f, h, a]);
|
|
562
562
|
})
|
|
563
563
|
);
|
|
564
564
|
}
|
|
@@ -574,42 +574,42 @@ class bt {
|
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
576
|
function yt({ name: n, email: r, timestamp: o, timezoneOffset: s }) {
|
|
577
|
-
return s =
|
|
577
|
+
return s = He(s), `${n} <${r}> ${o} ${s}`;
|
|
578
578
|
}
|
|
579
|
-
function
|
|
580
|
-
const r = ze(
|
|
579
|
+
function He(n) {
|
|
580
|
+
const r = qe(ze(n));
|
|
581
581
|
n = Math.abs(n);
|
|
582
582
|
const o = Math.floor(n / 60);
|
|
583
583
|
n -= o * 60;
|
|
584
|
-
let s = String(o),
|
|
585
|
-
return s.length < 2 && (s = "0" + s),
|
|
584
|
+
let s = String(o), u = String(n);
|
|
585
|
+
return s.length < 2 && (s = "0" + s), u.length < 2 && (u = "0" + u), (r === -1 ? "-" : "+") + s + u;
|
|
586
586
|
}
|
|
587
|
-
function
|
|
587
|
+
function qe(n) {
|
|
588
588
|
return Math.sign(n) || (Object.is(n, -0) ? -1 : 1);
|
|
589
589
|
}
|
|
590
|
-
function
|
|
590
|
+
function ze(n) {
|
|
591
591
|
return n === 0 ? n : -n;
|
|
592
592
|
}
|
|
593
|
-
function
|
|
593
|
+
function G(n) {
|
|
594
594
|
return n = n.replace(/\r/g, ""), n = n.replace(/^\n+/, ""), n = n.replace(/\n+$/, "") + `
|
|
595
595
|
`, n;
|
|
596
596
|
}
|
|
597
597
|
function it(n) {
|
|
598
|
-
const [, r, o, s,
|
|
598
|
+
const [, r, o, s, u] = n.match(
|
|
599
599
|
/^(.*) <(.*)> (.*) (.*)$/
|
|
600
600
|
);
|
|
601
601
|
return {
|
|
602
602
|
name: r,
|
|
603
603
|
email: o,
|
|
604
604
|
timestamp: Number(s),
|
|
605
|
-
timezoneOffset:
|
|
605
|
+
timezoneOffset: We(u)
|
|
606
606
|
};
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function We(n) {
|
|
609
609
|
let [, r, o, s] = n.match(/(\+|-)(\d\d)(\d\d)/);
|
|
610
|
-
return s = (r === "+" ? 1 : -1) * (Number(o) * 60 + Number(s)),
|
|
610
|
+
return s = (r === "+" ? 1 : -1) * (Number(o) * 60 + Number(s)), Ye(s);
|
|
611
611
|
}
|
|
612
|
-
function
|
|
612
|
+
function Ye(n) {
|
|
613
613
|
return n === 0 ? n : -n;
|
|
614
614
|
}
|
|
615
615
|
class Z {
|
|
@@ -660,18 +660,18 @@ ${r.gpgsig ? r.gpgsig : ""}`;
|
|
|
660
660
|
headers() {
|
|
661
661
|
const r = this.justHeaders().split(`
|
|
662
662
|
`), o = [];
|
|
663
|
-
for (const
|
|
664
|
-
|
|
665
|
-
` +
|
|
663
|
+
for (const u of r)
|
|
664
|
+
u[0] === " " ? o[o.length - 1] += `
|
|
665
|
+
` + u.slice(1) : o.push(u);
|
|
666
666
|
const s = {};
|
|
667
|
-
for (const
|
|
668
|
-
const
|
|
669
|
-
Array.isArray(s[
|
|
667
|
+
for (const u of o) {
|
|
668
|
+
const f = u.slice(0, u.indexOf(" ")), h = u.slice(u.indexOf(" ") + 1);
|
|
669
|
+
Array.isArray(s[f]) ? s[f].push(h) : s[f] = h;
|
|
670
670
|
}
|
|
671
671
|
return s.tagger && (s.tagger = it(s.tagger)), s.committer && (s.committer = it(s.committer)), s;
|
|
672
672
|
}
|
|
673
673
|
withoutSignature() {
|
|
674
|
-
const r =
|
|
674
|
+
const r = G(this._tag);
|
|
675
675
|
return r.indexOf(`
|
|
676
676
|
-----BEGIN PGP SIGNATURE-----`) === -1 ? r : r.slice(0, r.lastIndexOf(`
|
|
677
677
|
-----BEGIN PGP SIGNATURE-----`));
|
|
@@ -684,7 +684,7 @@ ${r.gpgsig ? r.gpgsig : ""}`;
|
|
|
684
684
|
this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),
|
|
685
685
|
this._tag.indexOf("-----END PGP SIGNATURE-----") + 27
|
|
686
686
|
);
|
|
687
|
-
return
|
|
687
|
+
return G(r);
|
|
688
688
|
}
|
|
689
689
|
payload() {
|
|
690
690
|
return this.withoutSignature() + `
|
|
@@ -694,10 +694,10 @@ ${r.gpgsig ? r.gpgsig : ""}`;
|
|
|
694
694
|
return Buffer.from(this._tag, "utf8");
|
|
695
695
|
}
|
|
696
696
|
static async sign(r, o, s) {
|
|
697
|
-
const
|
|
698
|
-
let { signature:
|
|
699
|
-
|
|
700
|
-
const h =
|
|
697
|
+
const u = r.payload();
|
|
698
|
+
let { signature: f } = await o({ payload: u, secretKey: s });
|
|
699
|
+
f = G(f);
|
|
700
|
+
const h = u + f;
|
|
701
701
|
return Z.from(h);
|
|
702
702
|
}
|
|
703
703
|
}
|
|
@@ -707,7 +707,7 @@ function lt(n) {
|
|
|
707
707
|
`) + `
|
|
708
708
|
`;
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Ve(n) {
|
|
711
711
|
return n.split(`
|
|
712
712
|
`).map((r) => r.replace(/^ /, "")).join(`
|
|
713
713
|
`);
|
|
@@ -724,12 +724,12 @@ class O {
|
|
|
724
724
|
throw new _("invalid type passed to GitCommit constructor");
|
|
725
725
|
}
|
|
726
726
|
static fromPayloadSignature({ payload: r, signature: o }) {
|
|
727
|
-
const s = O.justHeaders(r),
|
|
727
|
+
const s = O.justHeaders(r), u = O.justMessage(r), f = G(
|
|
728
728
|
s + `
|
|
729
729
|
gpgsig` + lt(o) + `
|
|
730
|
-
` +
|
|
730
|
+
` + u
|
|
731
731
|
);
|
|
732
|
-
return new O(
|
|
732
|
+
return new O(f);
|
|
733
733
|
}
|
|
734
734
|
static from(r) {
|
|
735
735
|
return new O(r);
|
|
@@ -749,7 +749,7 @@ gpgsig` + lt(o) + `
|
|
|
749
749
|
return Object.assign({ message: this.message() }, this.headers());
|
|
750
750
|
}
|
|
751
751
|
static justMessage(r) {
|
|
752
|
-
return
|
|
752
|
+
return G(r.slice(r.indexOf(`
|
|
753
753
|
|
|
754
754
|
`) + 2));
|
|
755
755
|
}
|
|
@@ -761,15 +761,15 @@ gpgsig` + lt(o) + `
|
|
|
761
761
|
parseHeaders() {
|
|
762
762
|
const r = O.justHeaders(this._commit).split(`
|
|
763
763
|
`), o = [];
|
|
764
|
-
for (const
|
|
765
|
-
|
|
766
|
-
` +
|
|
764
|
+
for (const u of r)
|
|
765
|
+
u[0] === " " ? o[o.length - 1] += `
|
|
766
|
+
` + u.slice(1) : o.push(u);
|
|
767
767
|
const s = {
|
|
768
768
|
parent: []
|
|
769
769
|
};
|
|
770
|
-
for (const
|
|
771
|
-
const
|
|
772
|
-
Array.isArray(s[
|
|
770
|
+
for (const u of o) {
|
|
771
|
+
const f = u.slice(0, u.indexOf(" ")), h = u.slice(u.indexOf(" ") + 1);
|
|
772
|
+
Array.isArray(s[f]) ? s[f].push(h) : s[f] = h;
|
|
773
773
|
}
|
|
774
774
|
return s.author && (s.author = it(s.author)), s.committer && (s.committer = it(s.committer)), s;
|
|
775
775
|
}
|
|
@@ -780,26 +780,26 @@ gpgsig` + lt(o) + `
|
|
|
780
780
|
`, r.parent) {
|
|
781
781
|
if (r.parent.length === void 0)
|
|
782
782
|
throw new _("commit 'parent' property should be an array");
|
|
783
|
-
for (const
|
|
784
|
-
o += `parent ${
|
|
783
|
+
for (const f of r.parent)
|
|
784
|
+
o += `parent ${f}
|
|
785
785
|
`;
|
|
786
786
|
}
|
|
787
787
|
const s = r.author;
|
|
788
788
|
o += `author ${yt(s)}
|
|
789
789
|
`;
|
|
790
|
-
const
|
|
791
|
-
return o += `committer ${yt(
|
|
790
|
+
const u = r.committer || r.author;
|
|
791
|
+
return o += `committer ${yt(u)}
|
|
792
792
|
`, r.gpgsig && (o += "gpgsig" + lt(r.gpgsig)), o;
|
|
793
793
|
}
|
|
794
794
|
static render(r) {
|
|
795
795
|
return O.renderHeaders(r) + `
|
|
796
|
-
` +
|
|
796
|
+
` + G(r.message);
|
|
797
797
|
}
|
|
798
798
|
render() {
|
|
799
799
|
return this._commit;
|
|
800
800
|
}
|
|
801
801
|
withoutSignature() {
|
|
802
|
-
const r =
|
|
802
|
+
const r = G(this._commit);
|
|
803
803
|
if (r.indexOf(`
|
|
804
804
|
gpgsig`) === -1)
|
|
805
805
|
return r;
|
|
@@ -808,7 +808,7 @@ gpgsig`)), s = r.slice(
|
|
|
808
808
|
r.indexOf(`-----END PGP SIGNATURE-----
|
|
809
809
|
`) + 28
|
|
810
810
|
);
|
|
811
|
-
return
|
|
811
|
+
return G(o + `
|
|
812
812
|
` + s);
|
|
813
813
|
}
|
|
814
814
|
isolateSignature() {
|
|
@@ -816,19 +816,19 @@ gpgsig`)), s = r.slice(
|
|
|
816
816
|
this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),
|
|
817
817
|
this._commit.indexOf("-----END PGP SIGNATURE-----") + 27
|
|
818
818
|
);
|
|
819
|
-
return
|
|
819
|
+
return Ve(r);
|
|
820
820
|
}
|
|
821
821
|
static async sign(r, o, s) {
|
|
822
|
-
const
|
|
823
|
-
let { signature: h } = await o({ payload:
|
|
824
|
-
h =
|
|
822
|
+
const u = r.withoutSignature(), f = O.justMessage(r._commit);
|
|
823
|
+
let { signature: h } = await o({ payload: u, secretKey: s });
|
|
824
|
+
h = G(h);
|
|
825
825
|
const w = O.justHeaders(r._commit) + `
|
|
826
826
|
gpgsig` + lt(h) + `
|
|
827
|
-
` +
|
|
827
|
+
` + f;
|
|
828
828
|
return O.from(w);
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
|
-
class
|
|
831
|
+
class Ke {
|
|
832
832
|
static wrap({ type: r, object: o }) {
|
|
833
833
|
return Buffer.concat([
|
|
834
834
|
Buffer.from(`${r} ${o.byteLength.toString()}\0`),
|
|
@@ -836,13 +836,13 @@ class Je {
|
|
|
836
836
|
]);
|
|
837
837
|
}
|
|
838
838
|
static unwrap(r) {
|
|
839
|
-
const o = r.indexOf(32), s = r.indexOf(0),
|
|
840
|
-
if (parseInt(
|
|
839
|
+
const o = r.indexOf(32), s = r.indexOf(0), u = r.slice(0, o).toString("utf8"), f = r.slice(o + 1, s).toString("utf8"), h = r.length - (s + 1);
|
|
840
|
+
if (parseInt(f) !== h)
|
|
841
841
|
throw new _(
|
|
842
|
-
`Length mismatch: expected ${
|
|
842
|
+
`Length mismatch: expected ${f} bytes but got ${h} instead.`
|
|
843
843
|
);
|
|
844
844
|
return {
|
|
845
|
-
type:
|
|
845
|
+
type: u,
|
|
846
846
|
object: Buffer.from(r.slice(s + 1))
|
|
847
847
|
};
|
|
848
848
|
}
|
|
@@ -869,12 +869,12 @@ class z {
|
|
|
869
869
|
return this._start += o, s;
|
|
870
870
|
}
|
|
871
871
|
write(r, o, s) {
|
|
872
|
-
const
|
|
873
|
-
return this._start += o,
|
|
872
|
+
const u = this.buffer.write(r, this._start, o, s);
|
|
873
|
+
return this._start += o, u;
|
|
874
874
|
}
|
|
875
875
|
copy(r, o, s) {
|
|
876
|
-
const
|
|
877
|
-
return this._start +=
|
|
876
|
+
const u = r.copy(this.buffer, this._start, o, s);
|
|
877
|
+
return this._start += u, u;
|
|
878
878
|
}
|
|
879
879
|
readUInt8() {
|
|
880
880
|
const r = this.buffer.readUInt8(this._start);
|
|
@@ -901,29 +901,29 @@ class z {
|
|
|
901
901
|
return this._start += 4, o;
|
|
902
902
|
}
|
|
903
903
|
}
|
|
904
|
-
function
|
|
904
|
+
function Je(n, r) {
|
|
905
905
|
const o = new z(n), s = Pt(o);
|
|
906
906
|
if (s !== r.byteLength)
|
|
907
907
|
throw new _(
|
|
908
908
|
`applyDelta expected source buffer to be ${s} bytes but the provided buffer was ${r.length} bytes`
|
|
909
909
|
);
|
|
910
|
-
const
|
|
911
|
-
let
|
|
912
|
-
const h =
|
|
913
|
-
if (h.byteLength ===
|
|
914
|
-
|
|
910
|
+
const u = Pt(o);
|
|
911
|
+
let f;
|
|
912
|
+
const h = Dt(o, r);
|
|
913
|
+
if (h.byteLength === u)
|
|
914
|
+
f = h;
|
|
915
915
|
else {
|
|
916
|
-
|
|
917
|
-
const
|
|
918
|
-
for (
|
|
919
|
-
|
|
920
|
-
const w =
|
|
921
|
-
if (
|
|
916
|
+
f = Buffer.alloc(u);
|
|
917
|
+
const a = new z(f);
|
|
918
|
+
for (a.copy(h); !o.eof(); )
|
|
919
|
+
a.copy(Dt(o, r));
|
|
920
|
+
const w = a.tell();
|
|
921
|
+
if (u !== w)
|
|
922
922
|
throw new _(
|
|
923
|
-
`applyDelta expected target buffer to be ${
|
|
923
|
+
`applyDelta expected target buffer to be ${u} bytes but the resulting buffer was ${w} bytes`
|
|
924
924
|
);
|
|
925
925
|
}
|
|
926
|
-
return
|
|
926
|
+
return f;
|
|
927
927
|
}
|
|
928
928
|
function Pt(n) {
|
|
929
929
|
let r = 0, o = 0, s = null;
|
|
@@ -932,33 +932,33 @@ function Pt(n) {
|
|
|
932
932
|
while (s & 128);
|
|
933
933
|
return r;
|
|
934
934
|
}
|
|
935
|
-
function
|
|
936
|
-
let s = 0,
|
|
935
|
+
function Nt(n, r, o) {
|
|
936
|
+
let s = 0, u = 0;
|
|
937
937
|
for (; o--; )
|
|
938
|
-
r & 1 && (s |= n.readUInt8() <<
|
|
938
|
+
r & 1 && (s |= n.readUInt8() << u), r >>= 1, u += 8;
|
|
939
939
|
return s;
|
|
940
940
|
}
|
|
941
|
-
function
|
|
942
|
-
const o = n.readUInt8(), s = 128,
|
|
941
|
+
function Dt(n, r) {
|
|
942
|
+
const o = n.readUInt8(), s = 128, u = 15, f = 112;
|
|
943
943
|
if (o & s) {
|
|
944
|
-
const h =
|
|
945
|
-
let
|
|
946
|
-
return
|
|
944
|
+
const h = Nt(n, o & u, 4);
|
|
945
|
+
let a = Nt(n, (o & f) >> 4, 3);
|
|
946
|
+
return a === 0 && (a = 65536), r.slice(h, h + a);
|
|
947
947
|
} else
|
|
948
948
|
return n.slice(o);
|
|
949
949
|
}
|
|
950
|
-
async function
|
|
951
|
-
const o = new
|
|
950
|
+
async function Xe(n, r) {
|
|
951
|
+
const o = new qt(n);
|
|
952
952
|
let s = await o.read(4);
|
|
953
953
|
if (s = s.toString("utf8"), s !== "PACK")
|
|
954
954
|
throw new _(`Invalid PACK header '${s}'`);
|
|
955
|
-
let f = await o.read(4);
|
|
956
|
-
if (f = f.readUInt32BE(0), f !== 2)
|
|
957
|
-
throw new _(`Invalid packfile version: ${f}`);
|
|
958
955
|
let u = await o.read(4);
|
|
959
|
-
if (u = u.readUInt32BE(0),
|
|
960
|
-
|
|
961
|
-
|
|
956
|
+
if (u = u.readUInt32BE(0), u !== 2)
|
|
957
|
+
throw new _(`Invalid packfile version: ${u}`);
|
|
958
|
+
let f = await o.read(4);
|
|
959
|
+
if (f = f.readUInt32BE(0), !(f < 1))
|
|
960
|
+
for (; !o.eof() && f--; ) {
|
|
961
|
+
const h = o.tell(), { type: a, length: w, ofs: y, reference: g } = await Ze(o), m = new vt.Inflate();
|
|
962
962
|
for (; !m.result; ) {
|
|
963
963
|
const b = await o.chunk();
|
|
964
964
|
if (!b)
|
|
@@ -974,8 +974,8 @@ async function Ze(n, r) {
|
|
|
974
974
|
const B = o.tell();
|
|
975
975
|
await r({
|
|
976
976
|
data: m.result,
|
|
977
|
-
type:
|
|
978
|
-
num:
|
|
977
|
+
type: a,
|
|
978
|
+
num: f,
|
|
979
979
|
offset: h,
|
|
980
980
|
end: B,
|
|
981
981
|
reference: g,
|
|
@@ -985,7 +985,7 @@ async function Ze(n, r) {
|
|
|
985
985
|
}
|
|
986
986
|
}
|
|
987
987
|
}
|
|
988
|
-
async function
|
|
988
|
+
async function Ze(n) {
|
|
989
989
|
let r = await n.byte();
|
|
990
990
|
const o = r >> 4 & 7;
|
|
991
991
|
let s = r & 15;
|
|
@@ -995,27 +995,27 @@ async function Qe(n) {
|
|
|
995
995
|
r = await n.byte(), s |= (r & 127) << h, h += 7;
|
|
996
996
|
while (r & 128);
|
|
997
997
|
}
|
|
998
|
-
let
|
|
998
|
+
let u, f;
|
|
999
999
|
if (o === 6) {
|
|
1000
1000
|
let h = 0;
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1001
|
+
u = 0;
|
|
1002
|
+
const a = [];
|
|
1003
1003
|
do
|
|
1004
|
-
r = await n.byte(),
|
|
1004
|
+
r = await n.byte(), u |= (r & 127) << h, h += 7, a.push(r);
|
|
1005
1005
|
while (r & 128);
|
|
1006
|
-
|
|
1006
|
+
f = Buffer.from(a);
|
|
1007
1007
|
}
|
|
1008
|
-
return o === 7 && (
|
|
1008
|
+
return o === 7 && (f = await n.read(20)), { type: o, length: s, ofs: u, reference: f };
|
|
1009
1009
|
}
|
|
1010
|
-
let
|
|
1011
|
-
async function
|
|
1012
|
-
return
|
|
1010
|
+
let Qe = !1;
|
|
1011
|
+
async function tr(n) {
|
|
1012
|
+
return Qe ? er(n) : vt.inflate(n);
|
|
1013
1013
|
}
|
|
1014
|
-
async function
|
|
1014
|
+
async function er(n) {
|
|
1015
1015
|
const r = new DecompressionStream("deflate"), o = new Blob([n]).stream().pipeThrough(r);
|
|
1016
1016
|
return new Uint8Array(await new Response(o).arrayBuffer());
|
|
1017
1017
|
}
|
|
1018
|
-
function
|
|
1018
|
+
function rr(n) {
|
|
1019
1019
|
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
1020
1020
|
}
|
|
1021
1021
|
var gt = { exports: {} };
|
|
@@ -1036,12 +1036,12 @@ typeof Object.create == "function" ? gt.exports = function(r, o) {
|
|
|
1036
1036
|
s.prototype = o.prototype, r.prototype = new s(), r.prototype.constructor = r;
|
|
1037
1037
|
}
|
|
1038
1038
|
};
|
|
1039
|
-
var
|
|
1040
|
-
st.byteLength =
|
|
1041
|
-
st.toByteArray =
|
|
1042
|
-
st.fromByteArray =
|
|
1043
|
-
var j = [], P = [],
|
|
1044
|
-
for (var K = 0,
|
|
1039
|
+
var nr = gt.exports, mt = { exports: {} }, H = {}, st = {};
|
|
1040
|
+
st.byteLength = sr;
|
|
1041
|
+
st.toByteArray = cr;
|
|
1042
|
+
st.fromByteArray = hr;
|
|
1043
|
+
var j = [], P = [], ir = typeof Uint8Array < "u" ? Uint8Array : Array, pt = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
1044
|
+
for (var K = 0, or = pt.length; K < or; ++K)
|
|
1045
1045
|
j[K] = pt[K], P[pt.charCodeAt(K)] = K;
|
|
1046
1046
|
P["-".charCodeAt(0)] = 62;
|
|
1047
1047
|
P["_".charCodeAt(0)] = 63;
|
|
@@ -1054,58 +1054,58 @@ function Yt(n) {
|
|
|
1054
1054
|
var s = o === r ? 0 : 4 - o % 4;
|
|
1055
1055
|
return [o, s];
|
|
1056
1056
|
}
|
|
1057
|
-
function
|
|
1057
|
+
function sr(n) {
|
|
1058
1058
|
var r = Yt(n), o = r[0], s = r[1];
|
|
1059
1059
|
return (o + s) * 3 / 4 - s;
|
|
1060
1060
|
}
|
|
1061
|
-
function
|
|
1061
|
+
function ar(n, r, o) {
|
|
1062
1062
|
return (r + o) * 3 / 4 - o;
|
|
1063
1063
|
}
|
|
1064
|
-
function
|
|
1065
|
-
var r, o = Yt(n), s = o[0],
|
|
1066
|
-
for (w = 0; w <
|
|
1067
|
-
r = P[n.charCodeAt(w)] << 18 | P[n.charCodeAt(w + 1)] << 12 | P[n.charCodeAt(w + 2)] << 6 | P[n.charCodeAt(w + 3)],
|
|
1068
|
-
return
|
|
1064
|
+
function cr(n) {
|
|
1065
|
+
var r, o = Yt(n), s = o[0], u = o[1], f = new ir(ar(n, s, u)), h = 0, a = u > 0 ? s - 4 : s, w;
|
|
1066
|
+
for (w = 0; w < a; w += 4)
|
|
1067
|
+
r = P[n.charCodeAt(w)] << 18 | P[n.charCodeAt(w + 1)] << 12 | P[n.charCodeAt(w + 2)] << 6 | P[n.charCodeAt(w + 3)], f[h++] = r >> 16 & 255, f[h++] = r >> 8 & 255, f[h++] = r & 255;
|
|
1068
|
+
return u === 2 && (r = P[n.charCodeAt(w)] << 2 | P[n.charCodeAt(w + 1)] >> 4, f[h++] = r & 255), u === 1 && (r = P[n.charCodeAt(w)] << 10 | P[n.charCodeAt(w + 1)] << 4 | P[n.charCodeAt(w + 2)] >> 2, f[h++] = r >> 8 & 255, f[h++] = r & 255), f;
|
|
1069
1069
|
}
|
|
1070
1070
|
function ur(n) {
|
|
1071
1071
|
return j[n >> 18 & 63] + j[n >> 12 & 63] + j[n >> 6 & 63] + j[n & 63];
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1074
|
-
for (var s,
|
|
1075
|
-
s = (n[
|
|
1076
|
-
return
|
|
1073
|
+
function fr(n, r, o) {
|
|
1074
|
+
for (var s, u = [], f = r; f < o; f += 3)
|
|
1075
|
+
s = (n[f] << 16 & 16711680) + (n[f + 1] << 8 & 65280) + (n[f + 2] & 255), u.push(ur(s));
|
|
1076
|
+
return u.join("");
|
|
1077
1077
|
}
|
|
1078
|
-
function
|
|
1079
|
-
for (var r, o = n.length, s = o % 3,
|
|
1080
|
-
|
|
1081
|
-
return s === 1 ? (r = n[o - 1],
|
|
1078
|
+
function hr(n) {
|
|
1079
|
+
for (var r, o = n.length, s = o % 3, u = [], f = 16383, h = 0, a = o - s; h < a; h += f)
|
|
1080
|
+
u.push(fr(n, h, h + f > a ? a : h + f));
|
|
1081
|
+
return s === 1 ? (r = n[o - 1], u.push(
|
|
1082
1082
|
j[r >> 2] + j[r << 4 & 63] + "=="
|
|
1083
|
-
)) : s === 2 && (r = (n[o - 2] << 8) + n[o - 1],
|
|
1083
|
+
)) : s === 2 && (r = (n[o - 2] << 8) + n[o - 1], u.push(
|
|
1084
1084
|
j[r >> 10] + j[r >> 4 & 63] + j[r << 2 & 63] + "="
|
|
1085
|
-
)),
|
|
1085
|
+
)), u.join("");
|
|
1086
1086
|
}
|
|
1087
1087
|
var xt = {};
|
|
1088
1088
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
1089
|
-
xt.read = function(n, r, o, s,
|
|
1090
|
-
var
|
|
1091
|
-
for (m += b,
|
|
1089
|
+
xt.read = function(n, r, o, s, u) {
|
|
1090
|
+
var f, h, a = u * 8 - s - 1, w = (1 << a) - 1, y = w >> 1, g = -7, m = o ? u - 1 : 0, b = o ? -1 : 1, B = n[r + m];
|
|
1091
|
+
for (m += b, f = B & (1 << -g) - 1, B >>= -g, g += a; g > 0; f = f * 256 + n[r + m], m += b, g -= 8)
|
|
1092
1092
|
;
|
|
1093
|
-
for (h =
|
|
1093
|
+
for (h = f & (1 << -g) - 1, f >>= -g, g += s; g > 0; h = h * 256 + n[r + m], m += b, g -= 8)
|
|
1094
1094
|
;
|
|
1095
|
-
if (
|
|
1096
|
-
|
|
1095
|
+
if (f === 0)
|
|
1096
|
+
f = 1 - y;
|
|
1097
1097
|
else {
|
|
1098
|
-
if (
|
|
1098
|
+
if (f === w)
|
|
1099
1099
|
return h ? NaN : (B ? -1 : 1) * (1 / 0);
|
|
1100
|
-
h = h + Math.pow(2, s),
|
|
1100
|
+
h = h + Math.pow(2, s), f = f - y;
|
|
1101
1101
|
}
|
|
1102
|
-
return (B ? -1 : 1) * h * Math.pow(2,
|
|
1102
|
+
return (B ? -1 : 1) * h * Math.pow(2, f - s);
|
|
1103
1103
|
};
|
|
1104
|
-
xt.write = function(n, r, o, s,
|
|
1105
|
-
var h,
|
|
1106
|
-
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (
|
|
1104
|
+
xt.write = function(n, r, o, s, u, f) {
|
|
1105
|
+
var h, a, w, y = f * 8 - u - 1, g = (1 << y) - 1, m = g >> 1, b = u === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, B = s ? 0 : f - 1, T = s ? 1 : -1, L = r < 0 || r === 0 && 1 / r < 0 ? 1 : 0;
|
|
1106
|
+
for (r = Math.abs(r), isNaN(r) || r === 1 / 0 ? (a = isNaN(r) ? 1 : 0, h = g) : (h = Math.floor(Math.log(r) / Math.LN2), r * (w = Math.pow(2, -h)) < 1 && (h--, w *= 2), h + m >= 1 ? r += b / w : r += b * Math.pow(2, 1 - m), r * w >= 2 && (h++, w /= 2), h + m >= g ? (a = 0, h = g) : h + m >= 1 ? (a = (r * w - 1) * Math.pow(2, u), h = h + m) : (a = r * Math.pow(2, m - 1) * Math.pow(2, u), h = 0)); u >= 8; n[o + B] = a & 255, B += T, a /= 256, u -= 8)
|
|
1107
1107
|
;
|
|
1108
|
-
for (h = h <<
|
|
1108
|
+
for (h = h << u | a, y += u; y > 0; n[o + B] = h & 255, B += T, h /= 256, y -= 8)
|
|
1109
1109
|
;
|
|
1110
1110
|
n[o + B - T] |= L * 128;
|
|
1111
1111
|
};
|
|
@@ -1117,12 +1117,12 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1117
1117
|
*/
|
|
1118
1118
|
(function(n) {
|
|
1119
1119
|
const r = st, o = xt, s = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
|
|
1120
|
-
n.Buffer =
|
|
1121
|
-
const
|
|
1122
|
-
n.kMaxLength =
|
|
1120
|
+
n.Buffer = a, n.SlowBuffer = M, n.INSPECT_MAX_BYTES = 50;
|
|
1121
|
+
const u = 2147483647;
|
|
1122
|
+
n.kMaxLength = u, a.TYPED_ARRAY_SUPPORT = f(), !a.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
|
|
1123
1123
|
"This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."
|
|
1124
1124
|
);
|
|
1125
|
-
function
|
|
1125
|
+
function f() {
|
|
1126
1126
|
try {
|
|
1127
1127
|
const i = new Uint8Array(1), t = { foo: function() {
|
|
1128
1128
|
return 42;
|
|
@@ -1132,26 +1132,26 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1132
1132
|
return !1;
|
|
1133
1133
|
}
|
|
1134
1134
|
}
|
|
1135
|
-
Object.defineProperty(
|
|
1135
|
+
Object.defineProperty(a.prototype, "parent", {
|
|
1136
1136
|
enumerable: !0,
|
|
1137
1137
|
get: function() {
|
|
1138
|
-
if (
|
|
1138
|
+
if (a.isBuffer(this))
|
|
1139
1139
|
return this.buffer;
|
|
1140
1140
|
}
|
|
1141
|
-
}), Object.defineProperty(
|
|
1141
|
+
}), Object.defineProperty(a.prototype, "offset", {
|
|
1142
1142
|
enumerable: !0,
|
|
1143
1143
|
get: function() {
|
|
1144
|
-
if (
|
|
1144
|
+
if (a.isBuffer(this))
|
|
1145
1145
|
return this.byteOffset;
|
|
1146
1146
|
}
|
|
1147
1147
|
});
|
|
1148
1148
|
function h(i) {
|
|
1149
|
-
if (i >
|
|
1149
|
+
if (i > u)
|
|
1150
1150
|
throw new RangeError('The value "' + i + '" is invalid for option "size"');
|
|
1151
1151
|
const t = new Uint8Array(i);
|
|
1152
|
-
return Object.setPrototypeOf(t,
|
|
1152
|
+
return Object.setPrototypeOf(t, a.prototype), t;
|
|
1153
1153
|
}
|
|
1154
|
-
function
|
|
1154
|
+
function a(i, t, e) {
|
|
1155
1155
|
if (typeof i == "number") {
|
|
1156
1156
|
if (typeof t == "string")
|
|
1157
1157
|
throw new TypeError(
|
|
@@ -1161,7 +1161,7 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1161
1161
|
}
|
|
1162
1162
|
return w(i, t, e);
|
|
1163
1163
|
}
|
|
1164
|
-
|
|
1164
|
+
a.poolSize = 8192;
|
|
1165
1165
|
function w(i, t, e) {
|
|
1166
1166
|
if (typeof i == "string")
|
|
1167
1167
|
return b(i, t);
|
|
@@ -1171,27 +1171,27 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1171
1171
|
throw new TypeError(
|
|
1172
1172
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
|
|
1173
1173
|
);
|
|
1174
|
-
if (
|
|
1174
|
+
if (D(i, ArrayBuffer) || i && D(i.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (D(i, SharedArrayBuffer) || i && D(i.buffer, SharedArrayBuffer)))
|
|
1175
1175
|
return L(i, t, e);
|
|
1176
1176
|
if (typeof i == "number")
|
|
1177
1177
|
throw new TypeError(
|
|
1178
1178
|
'The "value" argument must not be of type number. Received type number'
|
|
1179
1179
|
);
|
|
1180
|
-
const
|
|
1181
|
-
if (
|
|
1182
|
-
return
|
|
1183
|
-
const l =
|
|
1180
|
+
const c = i.valueOf && i.valueOf();
|
|
1181
|
+
if (c != null && c !== i)
|
|
1182
|
+
return a.from(c, t, e);
|
|
1183
|
+
const l = N(i);
|
|
1184
1184
|
if (l)
|
|
1185
1185
|
return l;
|
|
1186
1186
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof i[Symbol.toPrimitive] == "function")
|
|
1187
|
-
return
|
|
1187
|
+
return a.from(i[Symbol.toPrimitive]("string"), t, e);
|
|
1188
1188
|
throw new TypeError(
|
|
1189
1189
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof i
|
|
1190
1190
|
);
|
|
1191
1191
|
}
|
|
1192
|
-
|
|
1192
|
+
a.from = function(i, t, e) {
|
|
1193
1193
|
return w(i, t, e);
|
|
1194
|
-
}, Object.setPrototypeOf(
|
|
1194
|
+
}, Object.setPrototypeOf(a.prototype, Uint8Array.prototype), Object.setPrototypeOf(a, Uint8Array);
|
|
1195
1195
|
function y(i) {
|
|
1196
1196
|
if (typeof i != "number")
|
|
1197
1197
|
throw new TypeError('"size" argument must be of type number');
|
|
@@ -1201,33 +1201,33 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1201
1201
|
function g(i, t, e) {
|
|
1202
1202
|
return y(i), i <= 0 ? h(i) : t !== void 0 ? typeof e == "string" ? h(i).fill(t, e) : h(i).fill(t) : h(i);
|
|
1203
1203
|
}
|
|
1204
|
-
|
|
1204
|
+
a.alloc = function(i, t, e) {
|
|
1205
1205
|
return g(i, t, e);
|
|
1206
1206
|
};
|
|
1207
1207
|
function m(i) {
|
|
1208
1208
|
return y(i), h(i < 0 ? 0 : U(i) | 0);
|
|
1209
1209
|
}
|
|
1210
|
-
|
|
1210
|
+
a.allocUnsafe = function(i) {
|
|
1211
1211
|
return m(i);
|
|
1212
|
-
},
|
|
1212
|
+
}, a.allocUnsafeSlow = function(i) {
|
|
1213
1213
|
return m(i);
|
|
1214
1214
|
};
|
|
1215
1215
|
function b(i, t) {
|
|
1216
|
-
if ((typeof t != "string" || t === "") && (t = "utf8"), !
|
|
1216
|
+
if ((typeof t != "string" || t === "") && (t = "utf8"), !a.isEncoding(t))
|
|
1217
1217
|
throw new TypeError("Unknown encoding: " + t);
|
|
1218
1218
|
const e = $(i, t) | 0;
|
|
1219
|
-
let
|
|
1220
|
-
const l =
|
|
1221
|
-
return l !== e && (
|
|
1219
|
+
let c = h(e);
|
|
1220
|
+
const l = c.write(i, t);
|
|
1221
|
+
return l !== e && (c = c.slice(0, l)), c;
|
|
1222
1222
|
}
|
|
1223
1223
|
function B(i) {
|
|
1224
1224
|
const t = i.length < 0 ? 0 : U(i.length) | 0, e = h(t);
|
|
1225
|
-
for (let
|
|
1226
|
-
e[
|
|
1225
|
+
for (let c = 0; c < t; c += 1)
|
|
1226
|
+
e[c] = i[c] & 255;
|
|
1227
1227
|
return e;
|
|
1228
1228
|
}
|
|
1229
1229
|
function T(i) {
|
|
1230
|
-
if (
|
|
1230
|
+
if (D(i, Uint8Array)) {
|
|
1231
1231
|
const t = new Uint8Array(i);
|
|
1232
1232
|
return L(t.buffer, t.byteOffset, t.byteLength);
|
|
1233
1233
|
}
|
|
@@ -1238,11 +1238,11 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1238
1238
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
1239
1239
|
if (i.byteLength < t + (e || 0))
|
|
1240
1240
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
1241
|
-
let
|
|
1242
|
-
return t === void 0 && e === void 0 ?
|
|
1241
|
+
let c;
|
|
1242
|
+
return t === void 0 && e === void 0 ? c = new Uint8Array(i) : e === void 0 ? c = new Uint8Array(i, t) : c = new Uint8Array(i, t, e), Object.setPrototypeOf(c, a.prototype), c;
|
|
1243
1243
|
}
|
|
1244
|
-
function
|
|
1245
|
-
if (
|
|
1244
|
+
function N(i) {
|
|
1245
|
+
if (a.isBuffer(i)) {
|
|
1246
1246
|
const t = U(i.length) | 0, e = h(t);
|
|
1247
1247
|
return e.length === 0 || i.copy(e, 0, 0, t), e;
|
|
1248
1248
|
}
|
|
@@ -1252,30 +1252,30 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1252
1252
|
return B(i.data);
|
|
1253
1253
|
}
|
|
1254
1254
|
function U(i) {
|
|
1255
|
-
if (i >=
|
|
1256
|
-
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" +
|
|
1255
|
+
if (i >= u)
|
|
1256
|
+
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + u.toString(16) + " bytes");
|
|
1257
1257
|
return i | 0;
|
|
1258
1258
|
}
|
|
1259
1259
|
function M(i) {
|
|
1260
|
-
return +i != i && (i = 0),
|
|
1260
|
+
return +i != i && (i = 0), a.alloc(+i);
|
|
1261
1261
|
}
|
|
1262
|
-
|
|
1263
|
-
return t != null && t._isBuffer === !0 && t !==
|
|
1264
|
-
},
|
|
1265
|
-
if (
|
|
1262
|
+
a.isBuffer = function(t) {
|
|
1263
|
+
return t != null && t._isBuffer === !0 && t !== a.prototype;
|
|
1264
|
+
}, a.compare = function(t, e) {
|
|
1265
|
+
if (D(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), D(e, Uint8Array) && (e = a.from(e, e.offset, e.byteLength)), !a.isBuffer(t) || !a.isBuffer(e))
|
|
1266
1266
|
throw new TypeError(
|
|
1267
1267
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
1268
1268
|
);
|
|
1269
1269
|
if (t === e)
|
|
1270
1270
|
return 0;
|
|
1271
|
-
let
|
|
1272
|
-
for (let p = 0, d = Math.min(
|
|
1271
|
+
let c = t.length, l = e.length;
|
|
1272
|
+
for (let p = 0, d = Math.min(c, l); p < d; ++p)
|
|
1273
1273
|
if (t[p] !== e[p]) {
|
|
1274
|
-
|
|
1274
|
+
c = t[p], l = e[p];
|
|
1275
1275
|
break;
|
|
1276
1276
|
}
|
|
1277
|
-
return
|
|
1278
|
-
},
|
|
1277
|
+
return c < l ? -1 : l < c ? 1 : 0;
|
|
1278
|
+
}, a.isEncoding = function(t) {
|
|
1279
1279
|
switch (String(t).toLowerCase()) {
|
|
1280
1280
|
case "hex":
|
|
1281
1281
|
case "utf8":
|
|
@@ -1292,26 +1292,26 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1292
1292
|
default:
|
|
1293
1293
|
return !1;
|
|
1294
1294
|
}
|
|
1295
|
-
},
|
|
1295
|
+
}, a.concat = function(t, e) {
|
|
1296
1296
|
if (!Array.isArray(t))
|
|
1297
1297
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1298
1298
|
if (t.length === 0)
|
|
1299
|
-
return
|
|
1300
|
-
let
|
|
1299
|
+
return a.alloc(0);
|
|
1300
|
+
let c;
|
|
1301
1301
|
if (e === void 0)
|
|
1302
|
-
for (e = 0,
|
|
1303
|
-
e += t[
|
|
1304
|
-
const l =
|
|
1302
|
+
for (e = 0, c = 0; c < t.length; ++c)
|
|
1303
|
+
e += t[c].length;
|
|
1304
|
+
const l = a.allocUnsafe(e);
|
|
1305
1305
|
let p = 0;
|
|
1306
|
-
for (
|
|
1307
|
-
let d = t[
|
|
1308
|
-
if (
|
|
1309
|
-
p + d.length > l.length ? (
|
|
1306
|
+
for (c = 0; c < t.length; ++c) {
|
|
1307
|
+
let d = t[c];
|
|
1308
|
+
if (D(d, Uint8Array))
|
|
1309
|
+
p + d.length > l.length ? (a.isBuffer(d) || (d = a.from(d)), d.copy(l, p)) : Uint8Array.prototype.set.call(
|
|
1310
1310
|
l,
|
|
1311
1311
|
d,
|
|
1312
1312
|
p
|
|
1313
1313
|
);
|
|
1314
|
-
else if (
|
|
1314
|
+
else if (a.isBuffer(d))
|
|
1315
1315
|
d.copy(l, p);
|
|
1316
1316
|
else
|
|
1317
1317
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
@@ -1320,16 +1320,16 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1320
1320
|
return l;
|
|
1321
1321
|
};
|
|
1322
1322
|
function $(i, t) {
|
|
1323
|
-
if (
|
|
1323
|
+
if (a.isBuffer(i))
|
|
1324
1324
|
return i.length;
|
|
1325
|
-
if (ArrayBuffer.isView(i) ||
|
|
1325
|
+
if (ArrayBuffer.isView(i) || D(i, ArrayBuffer))
|
|
1326
1326
|
return i.byteLength;
|
|
1327
1327
|
if (typeof i != "string")
|
|
1328
1328
|
throw new TypeError(
|
|
1329
1329
|
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof i
|
|
1330
1330
|
);
|
|
1331
|
-
const e = i.length,
|
|
1332
|
-
if (!
|
|
1331
|
+
const e = i.length, c = arguments.length > 2 && arguments[2] === !0;
|
|
1332
|
+
if (!c && e === 0)
|
|
1333
1333
|
return 0;
|
|
1334
1334
|
let l = !1;
|
|
1335
1335
|
for (; ; )
|
|
@@ -1340,7 +1340,7 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1340
1340
|
return e;
|
|
1341
1341
|
case "utf8":
|
|
1342
1342
|
case "utf-8":
|
|
1343
|
-
return
|
|
1343
|
+
return ft(i).length;
|
|
1344
1344
|
case "ucs2":
|
|
1345
1345
|
case "ucs-2":
|
|
1346
1346
|
case "utf16le":
|
|
@@ -1352,94 +1352,94 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1352
1352
|
return Rt(i).length;
|
|
1353
1353
|
default:
|
|
1354
1354
|
if (l)
|
|
1355
|
-
return
|
|
1355
|
+
return c ? -1 : ft(i).length;
|
|
1356
1356
|
t = ("" + t).toLowerCase(), l = !0;
|
|
1357
1357
|
}
|
|
1358
1358
|
}
|
|
1359
|
-
|
|
1360
|
-
function
|
|
1361
|
-
let
|
|
1359
|
+
a.byteLength = $;
|
|
1360
|
+
function v(i, t, e) {
|
|
1361
|
+
let c = !1;
|
|
1362
1362
|
if ((t === void 0 || t < 0) && (t = 0), t > this.length || ((e === void 0 || e > this.length) && (e = this.length), e <= 0) || (e >>>= 0, t >>>= 0, e <= t))
|
|
1363
1363
|
return "";
|
|
1364
1364
|
for (i || (i = "utf8"); ; )
|
|
1365
1365
|
switch (i) {
|
|
1366
1366
|
case "hex":
|
|
1367
|
-
return
|
|
1367
|
+
return pe(this, t, e);
|
|
1368
1368
|
case "utf8":
|
|
1369
1369
|
case "utf-8":
|
|
1370
1370
|
return It(this, t, e);
|
|
1371
1371
|
case "ascii":
|
|
1372
|
-
return
|
|
1372
|
+
return he(this, t, e);
|
|
1373
1373
|
case "latin1":
|
|
1374
1374
|
case "binary":
|
|
1375
|
-
return
|
|
1375
|
+
return le(this, t, e);
|
|
1376
1376
|
case "base64":
|
|
1377
1377
|
return ue(this, t, e);
|
|
1378
1378
|
case "ucs2":
|
|
1379
1379
|
case "ucs-2":
|
|
1380
1380
|
case "utf16le":
|
|
1381
1381
|
case "utf-16le":
|
|
1382
|
-
return
|
|
1382
|
+
return de(this, t, e);
|
|
1383
1383
|
default:
|
|
1384
|
-
if (
|
|
1384
|
+
if (c)
|
|
1385
1385
|
throw new TypeError("Unknown encoding: " + i);
|
|
1386
|
-
i = (i + "").toLowerCase(),
|
|
1386
|
+
i = (i + "").toLowerCase(), c = !0;
|
|
1387
1387
|
}
|
|
1388
1388
|
}
|
|
1389
|
-
|
|
1389
|
+
a.prototype._isBuffer = !0;
|
|
1390
1390
|
function R(i, t, e) {
|
|
1391
|
-
const
|
|
1392
|
-
i[t] = i[e], i[e] =
|
|
1391
|
+
const c = i[t];
|
|
1392
|
+
i[t] = i[e], i[e] = c;
|
|
1393
1393
|
}
|
|
1394
|
-
|
|
1394
|
+
a.prototype.swap16 = function() {
|
|
1395
1395
|
const t = this.length;
|
|
1396
1396
|
if (t % 2 !== 0)
|
|
1397
1397
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
1398
1398
|
for (let e = 0; e < t; e += 2)
|
|
1399
1399
|
R(this, e, e + 1);
|
|
1400
1400
|
return this;
|
|
1401
|
-
},
|
|
1401
|
+
}, a.prototype.swap32 = function() {
|
|
1402
1402
|
const t = this.length;
|
|
1403
1403
|
if (t % 4 !== 0)
|
|
1404
1404
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
1405
1405
|
for (let e = 0; e < t; e += 4)
|
|
1406
1406
|
R(this, e, e + 3), R(this, e + 1, e + 2);
|
|
1407
1407
|
return this;
|
|
1408
|
-
},
|
|
1408
|
+
}, a.prototype.swap64 = function() {
|
|
1409
1409
|
const t = this.length;
|
|
1410
1410
|
if (t % 8 !== 0)
|
|
1411
1411
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
1412
1412
|
for (let e = 0; e < t; e += 8)
|
|
1413
1413
|
R(this, e, e + 7), R(this, e + 1, e + 6), R(this, e + 2, e + 5), R(this, e + 3, e + 4);
|
|
1414
1414
|
return this;
|
|
1415
|
-
},
|
|
1415
|
+
}, a.prototype.toString = function() {
|
|
1416
1416
|
const t = this.length;
|
|
1417
|
-
return t === 0 ? "" : arguments.length === 0 ? It(this, 0, t) :
|
|
1418
|
-
},
|
|
1419
|
-
if (!
|
|
1417
|
+
return t === 0 ? "" : arguments.length === 0 ? It(this, 0, t) : v.apply(this, arguments);
|
|
1418
|
+
}, a.prototype.toLocaleString = a.prototype.toString, a.prototype.equals = function(t) {
|
|
1419
|
+
if (!a.isBuffer(t))
|
|
1420
1420
|
throw new TypeError("Argument must be a Buffer");
|
|
1421
|
-
return this === t ? !0 :
|
|
1422
|
-
},
|
|
1421
|
+
return this === t ? !0 : a.compare(this, t) === 0;
|
|
1422
|
+
}, a.prototype.inspect = function() {
|
|
1423
1423
|
let t = "";
|
|
1424
1424
|
const e = n.INSPECT_MAX_BYTES;
|
|
1425
1425
|
return t = this.toString("hex", 0, e).replace(/(.{2})/g, "$1 ").trim(), this.length > e && (t += " ... "), "<Buffer " + t + ">";
|
|
1426
|
-
}, s && (
|
|
1427
|
-
if (
|
|
1426
|
+
}, s && (a.prototype[s] = a.prototype.inspect), a.prototype.compare = function(t, e, c, l, p) {
|
|
1427
|
+
if (D(t, Uint8Array) && (t = a.from(t, t.offset, t.byteLength)), !a.isBuffer(t))
|
|
1428
1428
|
throw new TypeError(
|
|
1429
1429
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof t
|
|
1430
1430
|
);
|
|
1431
|
-
if (e === void 0 && (e = 0),
|
|
1431
|
+
if (e === void 0 && (e = 0), c === void 0 && (c = t ? t.length : 0), l === void 0 && (l = 0), p === void 0 && (p = this.length), e < 0 || c > t.length || l < 0 || p > this.length)
|
|
1432
1432
|
throw new RangeError("out of range index");
|
|
1433
|
-
if (l >= p && e >=
|
|
1433
|
+
if (l >= p && e >= c)
|
|
1434
1434
|
return 0;
|
|
1435
1435
|
if (l >= p)
|
|
1436
1436
|
return -1;
|
|
1437
|
-
if (e >=
|
|
1437
|
+
if (e >= c)
|
|
1438
1438
|
return 1;
|
|
1439
|
-
if (e >>>= 0,
|
|
1439
|
+
if (e >>>= 0, c >>>= 0, l >>>= 0, p >>>= 0, this === t)
|
|
1440
1440
|
return 0;
|
|
1441
|
-
let d = p - l, x =
|
|
1442
|
-
const A = Math.min(d, x), I = this.slice(l, p), F = t.slice(e,
|
|
1441
|
+
let d = p - l, x = c - e;
|
|
1442
|
+
const A = Math.min(d, x), I = this.slice(l, p), F = t.slice(e, c);
|
|
1443
1443
|
for (let E = 0; E < A; ++E)
|
|
1444
1444
|
if (I[E] !== F[E]) {
|
|
1445
1445
|
d = I[E], x = F[E];
|
|
@@ -1447,10 +1447,10 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1447
1447
|
}
|
|
1448
1448
|
return d < x ? -1 : x < d ? 1 : 0;
|
|
1449
1449
|
};
|
|
1450
|
-
function Bt(i, t, e,
|
|
1450
|
+
function Bt(i, t, e, c, l) {
|
|
1451
1451
|
if (i.length === 0)
|
|
1452
1452
|
return -1;
|
|
1453
|
-
if (typeof e == "string" ? (
|
|
1453
|
+
if (typeof e == "string" ? (c = e, e = 0) : e > 2147483647 ? e = 2147483647 : e < -2147483648 && (e = -2147483648), e = +e, ht(e) && (e = l ? 0 : i.length - 1), e < 0 && (e = i.length + e), e >= i.length) {
|
|
1454
1454
|
if (l)
|
|
1455
1455
|
return -1;
|
|
1456
1456
|
e = i.length - 1;
|
|
@@ -1459,15 +1459,15 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1459
1459
|
e = 0;
|
|
1460
1460
|
else
|
|
1461
1461
|
return -1;
|
|
1462
|
-
if (typeof t == "string" && (t =
|
|
1463
|
-
return t.length === 0 ? -1 : Et(i, t, e,
|
|
1462
|
+
if (typeof t == "string" && (t = a.from(t, c)), a.isBuffer(t))
|
|
1463
|
+
return t.length === 0 ? -1 : Et(i, t, e, c, l);
|
|
1464
1464
|
if (typeof t == "number")
|
|
1465
|
-
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : Et(i, [t], e,
|
|
1465
|
+
return t = t & 255, typeof Uint8Array.prototype.indexOf == "function" ? l ? Uint8Array.prototype.indexOf.call(i, t, e) : Uint8Array.prototype.lastIndexOf.call(i, t, e) : Et(i, [t], e, c, l);
|
|
1466
1466
|
throw new TypeError("val must be string, number or Buffer");
|
|
1467
1467
|
}
|
|
1468
|
-
function Et(i, t, e,
|
|
1468
|
+
function Et(i, t, e, c, l) {
|
|
1469
1469
|
let p = 1, d = i.length, x = t.length;
|
|
1470
|
-
if (
|
|
1470
|
+
if (c !== void 0 && (c = String(c).toLowerCase(), c === "ucs2" || c === "ucs-2" || c === "utf16le" || c === "utf-16le")) {
|
|
1471
1471
|
if (i.length < 2 || t.length < 2)
|
|
1472
1472
|
return -1;
|
|
1473
1473
|
p = 2, d /= 2, x /= 2, e /= 2;
|
|
@@ -1497,21 +1497,21 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1497
1497
|
}
|
|
1498
1498
|
return -1;
|
|
1499
1499
|
}
|
|
1500
|
-
|
|
1501
|
-
return this.indexOf(t, e,
|
|
1502
|
-
},
|
|
1503
|
-
return Bt(this, t, e,
|
|
1504
|
-
},
|
|
1505
|
-
return Bt(this, t, e,
|
|
1500
|
+
a.prototype.includes = function(t, e, c) {
|
|
1501
|
+
return this.indexOf(t, e, c) !== -1;
|
|
1502
|
+
}, a.prototype.indexOf = function(t, e, c) {
|
|
1503
|
+
return Bt(this, t, e, c, !0);
|
|
1504
|
+
}, a.prototype.lastIndexOf = function(t, e, c) {
|
|
1505
|
+
return Bt(this, t, e, c, !1);
|
|
1506
1506
|
};
|
|
1507
|
-
function
|
|
1507
|
+
function ie(i, t, e, c) {
|
|
1508
1508
|
e = Number(e) || 0;
|
|
1509
1509
|
const l = i.length - e;
|
|
1510
|
-
|
|
1510
|
+
c ? (c = Number(c), c > l && (c = l)) : c = l;
|
|
1511
1511
|
const p = t.length;
|
|
1512
|
-
|
|
1512
|
+
c > p / 2 && (c = p / 2);
|
|
1513
1513
|
let d;
|
|
1514
|
-
for (d = 0; d <
|
|
1514
|
+
for (d = 0; d < c; ++d) {
|
|
1515
1515
|
const x = parseInt(t.substr(d * 2, 2), 16);
|
|
1516
1516
|
if (ht(x))
|
|
1517
1517
|
return d;
|
|
@@ -1519,58 +1519,58 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1519
1519
|
}
|
|
1520
1520
|
return d;
|
|
1521
1521
|
}
|
|
1522
|
-
function
|
|
1523
|
-
return nt(
|
|
1522
|
+
function oe(i, t, e, c) {
|
|
1523
|
+
return nt(ft(t, i.length - e), i, e, c);
|
|
1524
1524
|
}
|
|
1525
|
-
function
|
|
1526
|
-
return nt(
|
|
1525
|
+
function se(i, t, e, c) {
|
|
1526
|
+
return nt(me(t), i, e, c);
|
|
1527
1527
|
}
|
|
1528
|
-
function
|
|
1529
|
-
return nt(Rt(t), i, e,
|
|
1528
|
+
function ae(i, t, e, c) {
|
|
1529
|
+
return nt(Rt(t), i, e, c);
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
return nt(
|
|
1531
|
+
function ce(i, t, e, c) {
|
|
1532
|
+
return nt(be(t, i.length - e), i, e, c);
|
|
1533
1533
|
}
|
|
1534
|
-
|
|
1534
|
+
a.prototype.write = function(t, e, c, l) {
|
|
1535
1535
|
if (e === void 0)
|
|
1536
|
-
l = "utf8",
|
|
1537
|
-
else if (
|
|
1538
|
-
l = e,
|
|
1536
|
+
l = "utf8", c = this.length, e = 0;
|
|
1537
|
+
else if (c === void 0 && typeof e == "string")
|
|
1538
|
+
l = e, c = this.length, e = 0;
|
|
1539
1539
|
else if (isFinite(e))
|
|
1540
|
-
e = e >>> 0, isFinite(
|
|
1540
|
+
e = e >>> 0, isFinite(c) ? (c = c >>> 0, l === void 0 && (l = "utf8")) : (l = c, c = void 0);
|
|
1541
1541
|
else
|
|
1542
1542
|
throw new Error(
|
|
1543
1543
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
1544
1544
|
);
|
|
1545
1545
|
const p = this.length - e;
|
|
1546
|
-
if ((
|
|
1546
|
+
if ((c === void 0 || c > p) && (c = p), t.length > 0 && (c < 0 || e < 0) || e > this.length)
|
|
1547
1547
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
1548
1548
|
l || (l = "utf8");
|
|
1549
1549
|
let d = !1;
|
|
1550
1550
|
for (; ; )
|
|
1551
1551
|
switch (l) {
|
|
1552
1552
|
case "hex":
|
|
1553
|
-
return
|
|
1553
|
+
return ie(this, t, e, c);
|
|
1554
1554
|
case "utf8":
|
|
1555
1555
|
case "utf-8":
|
|
1556
|
-
return
|
|
1556
|
+
return oe(this, t, e, c);
|
|
1557
1557
|
case "ascii":
|
|
1558
1558
|
case "latin1":
|
|
1559
1559
|
case "binary":
|
|
1560
|
-
return
|
|
1560
|
+
return se(this, t, e, c);
|
|
1561
1561
|
case "base64":
|
|
1562
|
-
return
|
|
1562
|
+
return ae(this, t, e, c);
|
|
1563
1563
|
case "ucs2":
|
|
1564
1564
|
case "ucs-2":
|
|
1565
1565
|
case "utf16le":
|
|
1566
1566
|
case "utf-16le":
|
|
1567
|
-
return
|
|
1567
|
+
return ce(this, t, e, c);
|
|
1568
1568
|
default:
|
|
1569
1569
|
if (d)
|
|
1570
1570
|
throw new TypeError("Unknown encoding: " + l);
|
|
1571
1571
|
l = ("" + l).toLowerCase(), d = !0;
|
|
1572
1572
|
}
|
|
1573
|
-
},
|
|
1573
|
+
}, a.prototype.toJSON = function() {
|
|
1574
1574
|
return {
|
|
1575
1575
|
type: "Buffer",
|
|
1576
1576
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
@@ -1581,7 +1581,7 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1581
1581
|
}
|
|
1582
1582
|
function It(i, t, e) {
|
|
1583
1583
|
e = Math.min(i.length, e);
|
|
1584
|
-
const
|
|
1584
|
+
const c = [];
|
|
1585
1585
|
let l = t;
|
|
1586
1586
|
for (; l < e; ) {
|
|
1587
1587
|
const p = i[l];
|
|
@@ -1602,57 +1602,57 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1602
1602
|
A = i[l + 1], I = i[l + 2], F = i[l + 3], (A & 192) === 128 && (I & 192) === 128 && (F & 192) === 128 && (E = (p & 15) << 18 | (A & 63) << 12 | (I & 63) << 6 | F & 63, E > 65535 && E < 1114112 && (d = E));
|
|
1603
1603
|
}
|
|
1604
1604
|
}
|
|
1605
|
-
d === null ? (d = 65533, x = 1) : d > 65535 && (d -= 65536,
|
|
1605
|
+
d === null ? (d = 65533, x = 1) : d > 65535 && (d -= 65536, c.push(d >>> 10 & 1023 | 55296), d = 56320 | d & 1023), c.push(d), l += x;
|
|
1606
1606
|
}
|
|
1607
|
-
return
|
|
1607
|
+
return fe(c);
|
|
1608
1608
|
}
|
|
1609
1609
|
const _t = 4096;
|
|
1610
|
-
function
|
|
1610
|
+
function fe(i) {
|
|
1611
1611
|
const t = i.length;
|
|
1612
1612
|
if (t <= _t)
|
|
1613
1613
|
return String.fromCharCode.apply(String, i);
|
|
1614
|
-
let e = "",
|
|
1615
|
-
for (;
|
|
1614
|
+
let e = "", c = 0;
|
|
1615
|
+
for (; c < t; )
|
|
1616
1616
|
e += String.fromCharCode.apply(
|
|
1617
1617
|
String,
|
|
1618
|
-
i.slice(
|
|
1618
|
+
i.slice(c, c += _t)
|
|
1619
1619
|
);
|
|
1620
1620
|
return e;
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1623
|
-
let
|
|
1622
|
+
function he(i, t, e) {
|
|
1623
|
+
let c = "";
|
|
1624
1624
|
e = Math.min(i.length, e);
|
|
1625
1625
|
for (let l = t; l < e; ++l)
|
|
1626
|
-
|
|
1627
|
-
return
|
|
1626
|
+
c += String.fromCharCode(i[l] & 127);
|
|
1627
|
+
return c;
|
|
1628
1628
|
}
|
|
1629
|
-
function
|
|
1630
|
-
let
|
|
1629
|
+
function le(i, t, e) {
|
|
1630
|
+
let c = "";
|
|
1631
1631
|
e = Math.min(i.length, e);
|
|
1632
1632
|
for (let l = t; l < e; ++l)
|
|
1633
|
-
|
|
1634
|
-
return
|
|
1633
|
+
c += String.fromCharCode(i[l]);
|
|
1634
|
+
return c;
|
|
1635
1635
|
}
|
|
1636
|
-
function
|
|
1637
|
-
const
|
|
1638
|
-
(!t || t < 0) && (t = 0), (!e || e < 0 || e >
|
|
1636
|
+
function pe(i, t, e) {
|
|
1637
|
+
const c = i.length;
|
|
1638
|
+
(!t || t < 0) && (t = 0), (!e || e < 0 || e > c) && (e = c);
|
|
1639
1639
|
let l = "";
|
|
1640
1640
|
for (let p = t; p < e; ++p)
|
|
1641
|
-
l +=
|
|
1641
|
+
l += xe[i[p]];
|
|
1642
1642
|
return l;
|
|
1643
1643
|
}
|
|
1644
|
-
function
|
|
1645
|
-
const
|
|
1644
|
+
function de(i, t, e) {
|
|
1645
|
+
const c = i.slice(t, e);
|
|
1646
1646
|
let l = "";
|
|
1647
|
-
for (let p = 0; p <
|
|
1648
|
-
l += String.fromCharCode(
|
|
1647
|
+
for (let p = 0; p < c.length - 1; p += 2)
|
|
1648
|
+
l += String.fromCharCode(c[p] + c[p + 1] * 256);
|
|
1649
1649
|
return l;
|
|
1650
1650
|
}
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
t = ~~t, e = e === void 0 ?
|
|
1651
|
+
a.prototype.slice = function(t, e) {
|
|
1652
|
+
const c = this.length;
|
|
1653
|
+
t = ~~t, e = e === void 0 ? c : ~~e, t < 0 ? (t += c, t < 0 && (t = 0)) : t > c && (t = c), e < 0 ? (e += c, e < 0 && (e = 0)) : e > c && (e = c), e < t && (e = t);
|
|
1654
1654
|
const l = this.subarray(t, e);
|
|
1655
|
-
return Object.setPrototypeOf(l,
|
|
1655
|
+
return Object.setPrototypeOf(l, a.prototype), l;
|
|
1656
1656
|
};
|
|
1657
1657
|
function S(i, t, e) {
|
|
1658
1658
|
if (i % 1 !== 0 || i < 0)
|
|
@@ -1660,220 +1660,220 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1660
1660
|
if (i + t > e)
|
|
1661
1661
|
throw new RangeError("Trying to access beyond buffer length");
|
|
1662
1662
|
}
|
|
1663
|
-
|
|
1664
|
-
t = t >>> 0, e = e >>> 0,
|
|
1663
|
+
a.prototype.readUintLE = a.prototype.readUIntLE = function(t, e, c) {
|
|
1664
|
+
t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
|
|
1665
1665
|
let l = this[t], p = 1, d = 0;
|
|
1666
1666
|
for (; ++d < e && (p *= 256); )
|
|
1667
1667
|
l += this[t + d] * p;
|
|
1668
1668
|
return l;
|
|
1669
|
-
},
|
|
1670
|
-
t = t >>> 0, e = e >>> 0,
|
|
1669
|
+
}, a.prototype.readUintBE = a.prototype.readUIntBE = function(t, e, c) {
|
|
1670
|
+
t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
|
|
1671
1671
|
let l = this[t + --e], p = 1;
|
|
1672
1672
|
for (; e > 0 && (p *= 256); )
|
|
1673
1673
|
l += this[t + --e] * p;
|
|
1674
1674
|
return l;
|
|
1675
|
-
},
|
|
1675
|
+
}, a.prototype.readUint8 = a.prototype.readUInt8 = function(t, e) {
|
|
1676
1676
|
return t = t >>> 0, e || S(t, 1, this.length), this[t];
|
|
1677
|
-
},
|
|
1677
|
+
}, a.prototype.readUint16LE = a.prototype.readUInt16LE = function(t, e) {
|
|
1678
1678
|
return t = t >>> 0, e || S(t, 2, this.length), this[t] | this[t + 1] << 8;
|
|
1679
|
-
},
|
|
1679
|
+
}, a.prototype.readUint16BE = a.prototype.readUInt16BE = function(t, e) {
|
|
1680
1680
|
return t = t >>> 0, e || S(t, 2, this.length), this[t] << 8 | this[t + 1];
|
|
1681
|
-
},
|
|
1681
|
+
}, a.prototype.readUint32LE = a.prototype.readUInt32LE = function(t, e) {
|
|
1682
1682
|
return t = t >>> 0, e || S(t, 4, this.length), (this[t] | this[t + 1] << 8 | this[t + 2] << 16) + this[t + 3] * 16777216;
|
|
1683
|
-
},
|
|
1683
|
+
}, a.prototype.readUint32BE = a.prototype.readUInt32BE = function(t, e) {
|
|
1684
1684
|
return t = t >>> 0, e || S(t, 4, this.length), this[t] * 16777216 + (this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3]);
|
|
1685
|
-
},
|
|
1685
|
+
}, a.prototype.readBigUInt64LE = q(function(t) {
|
|
1686
1686
|
t = t >>> 0, V(t, "offset");
|
|
1687
|
-
const e = this[t],
|
|
1688
|
-
(e === void 0 ||
|
|
1689
|
-
const l = e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24, p = this[++t] + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 +
|
|
1687
|
+
const e = this[t], c = this[t + 7];
|
|
1688
|
+
(e === void 0 || c === void 0) && X(t, this.length - 8);
|
|
1689
|
+
const l = e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24, p = this[++t] + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + c * 2 ** 24;
|
|
1690
1690
|
return BigInt(l) + (BigInt(p) << BigInt(32));
|
|
1691
|
-
}),
|
|
1691
|
+
}), a.prototype.readBigUInt64BE = q(function(t) {
|
|
1692
1692
|
t = t >>> 0, V(t, "offset");
|
|
1693
|
-
const e = this[t],
|
|
1694
|
-
(e === void 0 ||
|
|
1695
|
-
const l = e * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t], p = this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 +
|
|
1693
|
+
const e = this[t], c = this[t + 7];
|
|
1694
|
+
(e === void 0 || c === void 0) && X(t, this.length - 8);
|
|
1695
|
+
const l = e * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t], p = this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + c;
|
|
1696
1696
|
return (BigInt(l) << BigInt(32)) + BigInt(p);
|
|
1697
|
-
}),
|
|
1698
|
-
t = t >>> 0, e = e >>> 0,
|
|
1697
|
+
}), a.prototype.readIntLE = function(t, e, c) {
|
|
1698
|
+
t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
|
|
1699
1699
|
let l = this[t], p = 1, d = 0;
|
|
1700
1700
|
for (; ++d < e && (p *= 256); )
|
|
1701
1701
|
l += this[t + d] * p;
|
|
1702
1702
|
return p *= 128, l >= p && (l -= Math.pow(2, 8 * e)), l;
|
|
1703
|
-
},
|
|
1704
|
-
t = t >>> 0, e = e >>> 0,
|
|
1703
|
+
}, a.prototype.readIntBE = function(t, e, c) {
|
|
1704
|
+
t = t >>> 0, e = e >>> 0, c || S(t, e, this.length);
|
|
1705
1705
|
let l = e, p = 1, d = this[t + --l];
|
|
1706
1706
|
for (; l > 0 && (p *= 256); )
|
|
1707
1707
|
d += this[t + --l] * p;
|
|
1708
1708
|
return p *= 128, d >= p && (d -= Math.pow(2, 8 * e)), d;
|
|
1709
|
-
},
|
|
1709
|
+
}, a.prototype.readInt8 = function(t, e) {
|
|
1710
1710
|
return t = t >>> 0, e || S(t, 1, this.length), this[t] & 128 ? (255 - this[t] + 1) * -1 : this[t];
|
|
1711
|
-
},
|
|
1711
|
+
}, a.prototype.readInt16LE = function(t, e) {
|
|
1712
1712
|
t = t >>> 0, e || S(t, 2, this.length);
|
|
1713
|
-
const
|
|
1714
|
-
return
|
|
1715
|
-
},
|
|
1713
|
+
const c = this[t] | this[t + 1] << 8;
|
|
1714
|
+
return c & 32768 ? c | 4294901760 : c;
|
|
1715
|
+
}, a.prototype.readInt16BE = function(t, e) {
|
|
1716
1716
|
t = t >>> 0, e || S(t, 2, this.length);
|
|
1717
|
-
const
|
|
1718
|
-
return
|
|
1719
|
-
},
|
|
1717
|
+
const c = this[t + 1] | this[t] << 8;
|
|
1718
|
+
return c & 32768 ? c | 4294901760 : c;
|
|
1719
|
+
}, a.prototype.readInt32LE = function(t, e) {
|
|
1720
1720
|
return t = t >>> 0, e || S(t, 4, this.length), this[t] | this[t + 1] << 8 | this[t + 2] << 16 | this[t + 3] << 24;
|
|
1721
|
-
},
|
|
1721
|
+
}, a.prototype.readInt32BE = function(t, e) {
|
|
1722
1722
|
return t = t >>> 0, e || S(t, 4, this.length), this[t] << 24 | this[t + 1] << 16 | this[t + 2] << 8 | this[t + 3];
|
|
1723
|
-
},
|
|
1723
|
+
}, a.prototype.readBigInt64LE = q(function(t) {
|
|
1724
1724
|
t = t >>> 0, V(t, "offset");
|
|
1725
|
-
const e = this[t],
|
|
1726
|
-
(e === void 0 ||
|
|
1727
|
-
const l = this[t + 4] + this[t + 5] * 2 ** 8 + this[t + 6] * 2 ** 16 + (
|
|
1725
|
+
const e = this[t], c = this[t + 7];
|
|
1726
|
+
(e === void 0 || c === void 0) && X(t, this.length - 8);
|
|
1727
|
+
const l = this[t + 4] + this[t + 5] * 2 ** 8 + this[t + 6] * 2 ** 16 + (c << 24);
|
|
1728
1728
|
return (BigInt(l) << BigInt(32)) + BigInt(e + this[++t] * 2 ** 8 + this[++t] * 2 ** 16 + this[++t] * 2 ** 24);
|
|
1729
|
-
}),
|
|
1729
|
+
}), a.prototype.readBigInt64BE = q(function(t) {
|
|
1730
1730
|
t = t >>> 0, V(t, "offset");
|
|
1731
|
-
const e = this[t],
|
|
1732
|
-
(e === void 0 ||
|
|
1731
|
+
const e = this[t], c = this[t + 7];
|
|
1732
|
+
(e === void 0 || c === void 0) && X(t, this.length - 8);
|
|
1733
1733
|
const l = (e << 24) + // Overflow
|
|
1734
1734
|
this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + this[++t];
|
|
1735
|
-
return (BigInt(l) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 +
|
|
1736
|
-
}),
|
|
1735
|
+
return (BigInt(l) << BigInt(32)) + BigInt(this[++t] * 2 ** 24 + this[++t] * 2 ** 16 + this[++t] * 2 ** 8 + c);
|
|
1736
|
+
}), a.prototype.readFloatLE = function(t, e) {
|
|
1737
1737
|
return t = t >>> 0, e || S(t, 4, this.length), o.read(this, t, !0, 23, 4);
|
|
1738
|
-
},
|
|
1738
|
+
}, a.prototype.readFloatBE = function(t, e) {
|
|
1739
1739
|
return t = t >>> 0, e || S(t, 4, this.length), o.read(this, t, !1, 23, 4);
|
|
1740
|
-
},
|
|
1740
|
+
}, a.prototype.readDoubleLE = function(t, e) {
|
|
1741
1741
|
return t = t >>> 0, e || S(t, 8, this.length), o.read(this, t, !0, 52, 8);
|
|
1742
|
-
},
|
|
1742
|
+
}, a.prototype.readDoubleBE = function(t, e) {
|
|
1743
1743
|
return t = t >>> 0, e || S(t, 8, this.length), o.read(this, t, !1, 52, 8);
|
|
1744
1744
|
};
|
|
1745
|
-
function C(i, t, e,
|
|
1746
|
-
if (!
|
|
1745
|
+
function C(i, t, e, c, l, p) {
|
|
1746
|
+
if (!a.isBuffer(i))
|
|
1747
1747
|
throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
1748
1748
|
if (t > l || t < p)
|
|
1749
1749
|
throw new RangeError('"value" argument is out of bounds');
|
|
1750
|
-
if (e +
|
|
1750
|
+
if (e + c > i.length)
|
|
1751
1751
|
throw new RangeError("Index out of range");
|
|
1752
1752
|
}
|
|
1753
|
-
|
|
1754
|
-
if (t = +t, e = e >>> 0,
|
|
1755
|
-
const x = Math.pow(2, 8 *
|
|
1756
|
-
C(this, t, e,
|
|
1753
|
+
a.prototype.writeUintLE = a.prototype.writeUIntLE = function(t, e, c, l) {
|
|
1754
|
+
if (t = +t, e = e >>> 0, c = c >>> 0, !l) {
|
|
1755
|
+
const x = Math.pow(2, 8 * c) - 1;
|
|
1756
|
+
C(this, t, e, c, x, 0);
|
|
1757
1757
|
}
|
|
1758
1758
|
let p = 1, d = 0;
|
|
1759
|
-
for (this[e] = t & 255; ++d <
|
|
1759
|
+
for (this[e] = t & 255; ++d < c && (p *= 256); )
|
|
1760
1760
|
this[e + d] = t / p & 255;
|
|
1761
|
-
return e +
|
|
1762
|
-
},
|
|
1763
|
-
if (t = +t, e = e >>> 0,
|
|
1764
|
-
const x = Math.pow(2, 8 *
|
|
1765
|
-
C(this, t, e,
|
|
1761
|
+
return e + c;
|
|
1762
|
+
}, a.prototype.writeUintBE = a.prototype.writeUIntBE = function(t, e, c, l) {
|
|
1763
|
+
if (t = +t, e = e >>> 0, c = c >>> 0, !l) {
|
|
1764
|
+
const x = Math.pow(2, 8 * c) - 1;
|
|
1765
|
+
C(this, t, e, c, x, 0);
|
|
1766
1766
|
}
|
|
1767
|
-
let p =
|
|
1767
|
+
let p = c - 1, d = 1;
|
|
1768
1768
|
for (this[e + p] = t & 255; --p >= 0 && (d *= 256); )
|
|
1769
1769
|
this[e + p] = t / d & 255;
|
|
1770
|
-
return e +
|
|
1771
|
-
},
|
|
1772
|
-
return t = +t, e = e >>> 0,
|
|
1773
|
-
},
|
|
1774
|
-
return t = +t, e = e >>> 0,
|
|
1775
|
-
},
|
|
1776
|
-
return t = +t, e = e >>> 0,
|
|
1777
|
-
},
|
|
1778
|
-
return t = +t, e = e >>> 0,
|
|
1779
|
-
},
|
|
1780
|
-
return t = +t, e = e >>> 0,
|
|
1770
|
+
return e + c;
|
|
1771
|
+
}, a.prototype.writeUint8 = a.prototype.writeUInt8 = function(t, e, c) {
|
|
1772
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 1, 255, 0), this[e] = t & 255, e + 1;
|
|
1773
|
+
}, a.prototype.writeUint16LE = a.prototype.writeUInt16LE = function(t, e, c) {
|
|
1774
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 2, 65535, 0), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
1775
|
+
}, a.prototype.writeUint16BE = a.prototype.writeUInt16BE = function(t, e, c) {
|
|
1776
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 2, 65535, 0), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
1777
|
+
}, a.prototype.writeUint32LE = a.prototype.writeUInt32LE = function(t, e, c) {
|
|
1778
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 4, 4294967295, 0), this[e + 3] = t >>> 24, this[e + 2] = t >>> 16, this[e + 1] = t >>> 8, this[e] = t & 255, e + 4;
|
|
1779
|
+
}, a.prototype.writeUint32BE = a.prototype.writeUInt32BE = function(t, e, c) {
|
|
1780
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 4, 4294967295, 0), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
1781
1781
|
};
|
|
1782
|
-
function At(i, t, e,
|
|
1783
|
-
$t(t,
|
|
1782
|
+
function At(i, t, e, c, l) {
|
|
1783
|
+
$t(t, c, l, i, e, 7);
|
|
1784
1784
|
let p = Number(t & BigInt(4294967295));
|
|
1785
1785
|
i[e++] = p, p = p >> 8, i[e++] = p, p = p >> 8, i[e++] = p, p = p >> 8, i[e++] = p;
|
|
1786
1786
|
let d = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
1787
1787
|
return i[e++] = d, d = d >> 8, i[e++] = d, d = d >> 8, i[e++] = d, d = d >> 8, i[e++] = d, e;
|
|
1788
1788
|
}
|
|
1789
|
-
function Ft(i, t, e,
|
|
1790
|
-
$t(t,
|
|
1789
|
+
function Ft(i, t, e, c, l) {
|
|
1790
|
+
$t(t, c, l, i, e, 7);
|
|
1791
1791
|
let p = Number(t & BigInt(4294967295));
|
|
1792
1792
|
i[e + 7] = p, p = p >> 8, i[e + 6] = p, p = p >> 8, i[e + 5] = p, p = p >> 8, i[e + 4] = p;
|
|
1793
1793
|
let d = Number(t >> BigInt(32) & BigInt(4294967295));
|
|
1794
1794
|
return i[e + 3] = d, d = d >> 8, i[e + 2] = d, d = d >> 8, i[e + 1] = d, d = d >> 8, i[e] = d, e + 8;
|
|
1795
1795
|
}
|
|
1796
|
-
|
|
1796
|
+
a.prototype.writeBigUInt64LE = q(function(t, e = 0) {
|
|
1797
1797
|
return At(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1798
|
-
}),
|
|
1798
|
+
}), a.prototype.writeBigUInt64BE = q(function(t, e = 0) {
|
|
1799
1799
|
return Ft(this, t, e, BigInt(0), BigInt("0xffffffffffffffff"));
|
|
1800
|
-
}),
|
|
1800
|
+
}), a.prototype.writeIntLE = function(t, e, c, l) {
|
|
1801
1801
|
if (t = +t, e = e >>> 0, !l) {
|
|
1802
|
-
const A = Math.pow(2, 8 *
|
|
1803
|
-
C(this, t, e,
|
|
1802
|
+
const A = Math.pow(2, 8 * c - 1);
|
|
1803
|
+
C(this, t, e, c, A - 1, -A);
|
|
1804
1804
|
}
|
|
1805
1805
|
let p = 0, d = 1, x = 0;
|
|
1806
|
-
for (this[e] = t & 255; ++p <
|
|
1806
|
+
for (this[e] = t & 255; ++p < c && (d *= 256); )
|
|
1807
1807
|
t < 0 && x === 0 && this[e + p - 1] !== 0 && (x = 1), this[e + p] = (t / d >> 0) - x & 255;
|
|
1808
|
-
return e +
|
|
1809
|
-
},
|
|
1808
|
+
return e + c;
|
|
1809
|
+
}, a.prototype.writeIntBE = function(t, e, c, l) {
|
|
1810
1810
|
if (t = +t, e = e >>> 0, !l) {
|
|
1811
|
-
const A = Math.pow(2, 8 *
|
|
1812
|
-
C(this, t, e,
|
|
1811
|
+
const A = Math.pow(2, 8 * c - 1);
|
|
1812
|
+
C(this, t, e, c, A - 1, -A);
|
|
1813
1813
|
}
|
|
1814
|
-
let p =
|
|
1814
|
+
let p = c - 1, d = 1, x = 0;
|
|
1815
1815
|
for (this[e + p] = t & 255; --p >= 0 && (d *= 256); )
|
|
1816
1816
|
t < 0 && x === 0 && this[e + p + 1] !== 0 && (x = 1), this[e + p] = (t / d >> 0) - x & 255;
|
|
1817
|
-
return e +
|
|
1818
|
-
},
|
|
1819
|
-
return t = +t, e = e >>> 0,
|
|
1820
|
-
},
|
|
1821
|
-
return t = +t, e = e >>> 0,
|
|
1822
|
-
},
|
|
1823
|
-
return t = +t, e = e >>> 0,
|
|
1824
|
-
},
|
|
1825
|
-
return t = +t, e = e >>> 0,
|
|
1826
|
-
},
|
|
1827
|
-
return t = +t, e = e >>> 0,
|
|
1828
|
-
},
|
|
1817
|
+
return e + c;
|
|
1818
|
+
}, a.prototype.writeInt8 = function(t, e, c) {
|
|
1819
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 1, 127, -128), t < 0 && (t = 255 + t + 1), this[e] = t & 255, e + 1;
|
|
1820
|
+
}, a.prototype.writeInt16LE = function(t, e, c) {
|
|
1821
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 2, 32767, -32768), this[e] = t & 255, this[e + 1] = t >>> 8, e + 2;
|
|
1822
|
+
}, a.prototype.writeInt16BE = function(t, e, c) {
|
|
1823
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 2, 32767, -32768), this[e] = t >>> 8, this[e + 1] = t & 255, e + 2;
|
|
1824
|
+
}, a.prototype.writeInt32LE = function(t, e, c) {
|
|
1825
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 4, 2147483647, -2147483648), this[e] = t & 255, this[e + 1] = t >>> 8, this[e + 2] = t >>> 16, this[e + 3] = t >>> 24, e + 4;
|
|
1826
|
+
}, a.prototype.writeInt32BE = function(t, e, c) {
|
|
1827
|
+
return t = +t, e = e >>> 0, c || C(this, t, e, 4, 2147483647, -2147483648), t < 0 && (t = 4294967295 + t + 1), this[e] = t >>> 24, this[e + 1] = t >>> 16, this[e + 2] = t >>> 8, this[e + 3] = t & 255, e + 4;
|
|
1828
|
+
}, a.prototype.writeBigInt64LE = q(function(t, e = 0) {
|
|
1829
1829
|
return At(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1830
|
-
}),
|
|
1830
|
+
}), a.prototype.writeBigInt64BE = q(function(t, e = 0) {
|
|
1831
1831
|
return Ft(this, t, e, -BigInt("0x8000000000000000"), BigInt("0x7fffffffffffffff"));
|
|
1832
1832
|
});
|
|
1833
|
-
function Ut(i, t, e,
|
|
1834
|
-
if (e +
|
|
1833
|
+
function Ut(i, t, e, c, l, p) {
|
|
1834
|
+
if (e + c > i.length)
|
|
1835
1835
|
throw new RangeError("Index out of range");
|
|
1836
1836
|
if (e < 0)
|
|
1837
1837
|
throw new RangeError("Index out of range");
|
|
1838
1838
|
}
|
|
1839
|
-
function St(i, t, e,
|
|
1840
|
-
return t = +t, e = e >>> 0, l || Ut(i, t, e, 4), o.write(i, t, e,
|
|
1839
|
+
function St(i, t, e, c, l) {
|
|
1840
|
+
return t = +t, e = e >>> 0, l || Ut(i, t, e, 4), o.write(i, t, e, c, 23, 4), e + 4;
|
|
1841
1841
|
}
|
|
1842
|
-
|
|
1843
|
-
return St(this, t, e, !0,
|
|
1844
|
-
},
|
|
1845
|
-
return St(this, t, e, !1,
|
|
1842
|
+
a.prototype.writeFloatLE = function(t, e, c) {
|
|
1843
|
+
return St(this, t, e, !0, c);
|
|
1844
|
+
}, a.prototype.writeFloatBE = function(t, e, c) {
|
|
1845
|
+
return St(this, t, e, !1, c);
|
|
1846
1846
|
};
|
|
1847
|
-
function kt(i, t, e,
|
|
1848
|
-
return t = +t, e = e >>> 0, l || Ut(i, t, e, 8), o.write(i, t, e,
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
return kt(this, t, e, !0,
|
|
1852
|
-
},
|
|
1853
|
-
return kt(this, t, e, !1,
|
|
1854
|
-
},
|
|
1855
|
-
if (!
|
|
1847
|
+
function kt(i, t, e, c, l) {
|
|
1848
|
+
return t = +t, e = e >>> 0, l || Ut(i, t, e, 8), o.write(i, t, e, c, 52, 8), e + 8;
|
|
1849
|
+
}
|
|
1850
|
+
a.prototype.writeDoubleLE = function(t, e, c) {
|
|
1851
|
+
return kt(this, t, e, !0, c);
|
|
1852
|
+
}, a.prototype.writeDoubleBE = function(t, e, c) {
|
|
1853
|
+
return kt(this, t, e, !1, c);
|
|
1854
|
+
}, a.prototype.copy = function(t, e, c, l) {
|
|
1855
|
+
if (!a.isBuffer(t))
|
|
1856
1856
|
throw new TypeError("argument should be a Buffer");
|
|
1857
|
-
if (
|
|
1857
|
+
if (c || (c = 0), !l && l !== 0 && (l = this.length), e >= t.length && (e = t.length), e || (e = 0), l > 0 && l < c && (l = c), l === c || t.length === 0 || this.length === 0)
|
|
1858
1858
|
return 0;
|
|
1859
1859
|
if (e < 0)
|
|
1860
1860
|
throw new RangeError("targetStart out of bounds");
|
|
1861
|
-
if (
|
|
1861
|
+
if (c < 0 || c >= this.length)
|
|
1862
1862
|
throw new RangeError("Index out of range");
|
|
1863
1863
|
if (l < 0)
|
|
1864
1864
|
throw new RangeError("sourceEnd out of bounds");
|
|
1865
|
-
l > this.length && (l = this.length), t.length - e < l -
|
|
1866
|
-
const p = l -
|
|
1867
|
-
return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e,
|
|
1865
|
+
l > this.length && (l = this.length), t.length - e < l - c && (l = t.length - e + c);
|
|
1866
|
+
const p = l - c;
|
|
1867
|
+
return this === t && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(e, c, l) : Uint8Array.prototype.set.call(
|
|
1868
1868
|
t,
|
|
1869
|
-
this.subarray(
|
|
1869
|
+
this.subarray(c, l),
|
|
1870
1870
|
e
|
|
1871
1871
|
), p;
|
|
1872
|
-
},
|
|
1872
|
+
}, a.prototype.fill = function(t, e, c, l) {
|
|
1873
1873
|
if (typeof t == "string") {
|
|
1874
|
-
if (typeof e == "string" ? (l = e, e = 0,
|
|
1874
|
+
if (typeof e == "string" ? (l = e, e = 0, c = this.length) : typeof c == "string" && (l = c, c = this.length), l !== void 0 && typeof l != "string")
|
|
1875
1875
|
throw new TypeError("encoding must be a string");
|
|
1876
|
-
if (typeof l == "string" && !
|
|
1876
|
+
if (typeof l == "string" && !a.isEncoding(l))
|
|
1877
1877
|
throw new TypeError("Unknown encoding: " + l);
|
|
1878
1878
|
if (t.length === 1) {
|
|
1879
1879
|
const d = t.charCodeAt(0);
|
|
@@ -1881,26 +1881,26 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1881
1881
|
}
|
|
1882
1882
|
} else
|
|
1883
1883
|
typeof t == "number" ? t = t & 255 : typeof t == "boolean" && (t = Number(t));
|
|
1884
|
-
if (e < 0 || this.length < e || this.length <
|
|
1884
|
+
if (e < 0 || this.length < e || this.length < c)
|
|
1885
1885
|
throw new RangeError("Out of range index");
|
|
1886
|
-
if (
|
|
1886
|
+
if (c <= e)
|
|
1887
1887
|
return this;
|
|
1888
|
-
e = e >>> 0,
|
|
1888
|
+
e = e >>> 0, c = c === void 0 ? this.length : c >>> 0, t || (t = 0);
|
|
1889
1889
|
let p;
|
|
1890
1890
|
if (typeof t == "number")
|
|
1891
|
-
for (p = e; p <
|
|
1891
|
+
for (p = e; p < c; ++p)
|
|
1892
1892
|
this[p] = t;
|
|
1893
1893
|
else {
|
|
1894
|
-
const d =
|
|
1894
|
+
const d = a.isBuffer(t) ? t : a.from(t, l), x = d.length;
|
|
1895
1895
|
if (x === 0)
|
|
1896
1896
|
throw new TypeError('The value "' + t + '" is invalid for argument "value"');
|
|
1897
|
-
for (p = 0; p <
|
|
1897
|
+
for (p = 0; p < c - e; ++p)
|
|
1898
1898
|
this[p + e] = d[p % x];
|
|
1899
1899
|
}
|
|
1900
1900
|
return this;
|
|
1901
1901
|
};
|
|
1902
1902
|
const Y = {};
|
|
1903
|
-
function
|
|
1903
|
+
function ut(i, t, e) {
|
|
1904
1904
|
Y[i] = class extends e {
|
|
1905
1905
|
constructor() {
|
|
1906
1906
|
super(), Object.defineProperty(this, "message", {
|
|
@@ -1925,43 +1925,43 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
};
|
|
1927
1927
|
}
|
|
1928
|
-
|
|
1928
|
+
ut(
|
|
1929
1929
|
"ERR_BUFFER_OUT_OF_BOUNDS",
|
|
1930
1930
|
function(i) {
|
|
1931
1931
|
return i ? `${i} is outside of buffer bounds` : "Attempt to access memory outside buffer bounds";
|
|
1932
1932
|
},
|
|
1933
1933
|
RangeError
|
|
1934
|
-
),
|
|
1934
|
+
), ut(
|
|
1935
1935
|
"ERR_INVALID_ARG_TYPE",
|
|
1936
1936
|
function(i, t) {
|
|
1937
1937
|
return `The "${i}" argument must be of type number. Received type ${typeof t}`;
|
|
1938
1938
|
},
|
|
1939
1939
|
TypeError
|
|
1940
|
-
),
|
|
1940
|
+
), ut(
|
|
1941
1941
|
"ERR_OUT_OF_RANGE",
|
|
1942
1942
|
function(i, t, e) {
|
|
1943
|
-
let
|
|
1944
|
-
return Number.isInteger(e) && Math.abs(e) > 2 ** 32 ? l = Tt(String(e)) : typeof e == "bigint" && (l = String(e), (e > BigInt(2) ** BigInt(32) || e < -(BigInt(2) ** BigInt(32))) && (l = Tt(l)), l += "n"),
|
|
1943
|
+
let c = `The value of "${i}" is out of range.`, l = e;
|
|
1944
|
+
return Number.isInteger(e) && Math.abs(e) > 2 ** 32 ? l = Tt(String(e)) : typeof e == "bigint" && (l = String(e), (e > BigInt(2) ** BigInt(32) || e < -(BigInt(2) ** BigInt(32))) && (l = Tt(l)), l += "n"), c += ` It must be ${t}. Received ${l}`, c;
|
|
1945
1945
|
},
|
|
1946
1946
|
RangeError
|
|
1947
1947
|
);
|
|
1948
1948
|
function Tt(i) {
|
|
1949
1949
|
let t = "", e = i.length;
|
|
1950
|
-
const
|
|
1951
|
-
for (; e >=
|
|
1950
|
+
const c = i[0] === "-" ? 1 : 0;
|
|
1951
|
+
for (; e >= c + 4; e -= 3)
|
|
1952
1952
|
t = `_${i.slice(e - 3, e)}${t}`;
|
|
1953
1953
|
return `${i.slice(0, e)}${t}`;
|
|
1954
1954
|
}
|
|
1955
|
-
function
|
|
1955
|
+
function we(i, t, e) {
|
|
1956
1956
|
V(t, "offset"), (i[t] === void 0 || i[t + e] === void 0) && X(t, i.length - (e + 1));
|
|
1957
1957
|
}
|
|
1958
|
-
function $t(i, t, e,
|
|
1958
|
+
function $t(i, t, e, c, l, p) {
|
|
1959
1959
|
if (i > e || i < t) {
|
|
1960
1960
|
const d = typeof t == "bigint" ? "n" : "";
|
|
1961
1961
|
let x;
|
|
1962
1962
|
throw p > 3 ? t === 0 || t === BigInt(0) ? x = `>= 0${d} and < 2${d} ** ${(p + 1) * 8}${d}` : x = `>= -(2${d} ** ${(p + 1) * 8 - 1}${d}) and < 2 ** ${(p + 1) * 8 - 1}${d}` : x = `>= ${t}${d} and <= ${e}${d}`, new Y.ERR_OUT_OF_RANGE("value", x, i);
|
|
1963
1963
|
}
|
|
1964
|
-
|
|
1964
|
+
we(c, l, p);
|
|
1965
1965
|
}
|
|
1966
1966
|
function V(i, t) {
|
|
1967
1967
|
if (typeof i != "number")
|
|
@@ -1974,27 +1974,27 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
1974
1974
|
i
|
|
1975
1975
|
);
|
|
1976
1976
|
}
|
|
1977
|
-
const
|
|
1978
|
-
function
|
|
1979
|
-
if (i = i.split("=")[0], i = i.trim().replace(
|
|
1977
|
+
const ye = /[^+/0-9A-Za-z-_]/g;
|
|
1978
|
+
function ge(i) {
|
|
1979
|
+
if (i = i.split("=")[0], i = i.trim().replace(ye, ""), i.length < 2)
|
|
1980
1980
|
return "";
|
|
1981
1981
|
for (; i.length % 4 !== 0; )
|
|
1982
1982
|
i = i + "=";
|
|
1983
1983
|
return i;
|
|
1984
1984
|
}
|
|
1985
|
-
function
|
|
1985
|
+
function ft(i, t) {
|
|
1986
1986
|
t = t || 1 / 0;
|
|
1987
1987
|
let e;
|
|
1988
|
-
const
|
|
1988
|
+
const c = i.length;
|
|
1989
1989
|
let l = null;
|
|
1990
1990
|
const p = [];
|
|
1991
|
-
for (let d = 0; d <
|
|
1991
|
+
for (let d = 0; d < c; ++d) {
|
|
1992
1992
|
if (e = i.charCodeAt(d), e > 55295 && e < 57344) {
|
|
1993
1993
|
if (!l) {
|
|
1994
1994
|
if (e > 56319) {
|
|
1995
1995
|
(t -= 3) > -1 && p.push(239, 191, 189);
|
|
1996
1996
|
continue;
|
|
1997
|
-
} else if (d + 1 ===
|
|
1997
|
+
} else if (d + 1 === c) {
|
|
1998
1998
|
(t -= 3) > -1 && p.push(239, 191, 189);
|
|
1999
1999
|
continue;
|
|
2000
2000
|
}
|
|
@@ -2041,75 +2041,75 @@ xt.write = function(n, r, o, s, f, u) {
|
|
|
2041
2041
|
}
|
|
2042
2042
|
return p;
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function me(i) {
|
|
2045
2045
|
const t = [];
|
|
2046
2046
|
for (let e = 0; e < i.length; ++e)
|
|
2047
2047
|
t.push(i.charCodeAt(e) & 255);
|
|
2048
2048
|
return t;
|
|
2049
2049
|
}
|
|
2050
|
-
function
|
|
2051
|
-
let e,
|
|
2050
|
+
function be(i, t) {
|
|
2051
|
+
let e, c, l;
|
|
2052
2052
|
const p = [];
|
|
2053
2053
|
for (let d = 0; d < i.length && !((t -= 2) < 0); ++d)
|
|
2054
|
-
e = i.charCodeAt(d),
|
|
2054
|
+
e = i.charCodeAt(d), c = e >> 8, l = e % 256, p.push(l), p.push(c);
|
|
2055
2055
|
return p;
|
|
2056
2056
|
}
|
|
2057
2057
|
function Rt(i) {
|
|
2058
|
-
return r.toByteArray(
|
|
2058
|
+
return r.toByteArray(ge(i));
|
|
2059
2059
|
}
|
|
2060
|
-
function nt(i, t, e,
|
|
2060
|
+
function nt(i, t, e, c) {
|
|
2061
2061
|
let l;
|
|
2062
|
-
for (l = 0; l <
|
|
2062
|
+
for (l = 0; l < c && !(l + e >= t.length || l >= i.length); ++l)
|
|
2063
2063
|
t[l + e] = i[l];
|
|
2064
2064
|
return l;
|
|
2065
2065
|
}
|
|
2066
|
-
function
|
|
2066
|
+
function D(i, t) {
|
|
2067
2067
|
return i instanceof t || i != null && i.constructor != null && i.constructor.name != null && i.constructor.name === t.name;
|
|
2068
2068
|
}
|
|
2069
2069
|
function ht(i) {
|
|
2070
2070
|
return i !== i;
|
|
2071
2071
|
}
|
|
2072
|
-
const
|
|
2072
|
+
const xe = function() {
|
|
2073
2073
|
const i = "0123456789abcdef", t = new Array(256);
|
|
2074
2074
|
for (let e = 0; e < 16; ++e) {
|
|
2075
|
-
const
|
|
2075
|
+
const c = e * 16;
|
|
2076
2076
|
for (let l = 0; l < 16; ++l)
|
|
2077
|
-
t[
|
|
2077
|
+
t[c + l] = i[e] + i[l];
|
|
2078
2078
|
}
|
|
2079
2079
|
return t;
|
|
2080
2080
|
}();
|
|
2081
|
-
function
|
|
2082
|
-
return typeof BigInt > "u" ?
|
|
2081
|
+
function q(i) {
|
|
2082
|
+
return typeof BigInt > "u" ? Be : i;
|
|
2083
2083
|
}
|
|
2084
|
-
function
|
|
2084
|
+
function Be() {
|
|
2085
2085
|
throw new Error("BigInt not supported");
|
|
2086
2086
|
}
|
|
2087
|
-
})(
|
|
2087
|
+
})(H);
|
|
2088
2088
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
2089
2089
|
(function(n, r) {
|
|
2090
|
-
var o =
|
|
2091
|
-
function
|
|
2090
|
+
var o = H, s = o.Buffer;
|
|
2091
|
+
function u(h, a) {
|
|
2092
2092
|
for (var w in h)
|
|
2093
|
-
|
|
2093
|
+
a[w] = h[w];
|
|
2094
2094
|
}
|
|
2095
|
-
s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? n.exports = o : (
|
|
2096
|
-
function
|
|
2097
|
-
return s(h,
|
|
2095
|
+
s.from && s.alloc && s.allocUnsafe && s.allocUnsafeSlow ? n.exports = o : (u(o, r), r.Buffer = f);
|
|
2096
|
+
function f(h, a, w) {
|
|
2097
|
+
return s(h, a, w);
|
|
2098
2098
|
}
|
|
2099
|
-
|
|
2099
|
+
f.prototype = Object.create(s.prototype), u(s, f), f.from = function(h, a, w) {
|
|
2100
2100
|
if (typeof h == "number")
|
|
2101
2101
|
throw new TypeError("Argument must not be a number");
|
|
2102
|
-
return s(h,
|
|
2103
|
-
},
|
|
2102
|
+
return s(h, a, w);
|
|
2103
|
+
}, f.alloc = function(h, a, w) {
|
|
2104
2104
|
if (typeof h != "number")
|
|
2105
2105
|
throw new TypeError("Argument must be a number");
|
|
2106
2106
|
var y = s(h);
|
|
2107
|
-
return
|
|
2108
|
-
},
|
|
2107
|
+
return a !== void 0 ? typeof w == "string" ? y.fill(a, w) : y.fill(a) : y.fill(0), y;
|
|
2108
|
+
}, f.allocUnsafe = function(h) {
|
|
2109
2109
|
if (typeof h != "number")
|
|
2110
2110
|
throw new TypeError("Argument must be a number");
|
|
2111
2111
|
return s(h);
|
|
2112
|
-
},
|
|
2112
|
+
}, f.allocUnsafeSlow = function(h) {
|
|
2113
2113
|
if (typeof h != "number")
|
|
2114
2114
|
throw new TypeError("Argument must be a number");
|
|
2115
2115
|
return o.SlowBuffer(h);
|
|
@@ -2121,12 +2121,12 @@ function at(n, r) {
|
|
|
2121
2121
|
}
|
|
2122
2122
|
at.prototype.update = function(n, r) {
|
|
2123
2123
|
typeof n == "string" && (r = r || "utf8", n = Kt.from(n, r));
|
|
2124
|
-
for (var o = this._block, s = this._blockSize,
|
|
2125
|
-
for (var
|
|
2126
|
-
o[
|
|
2127
|
-
|
|
2124
|
+
for (var o = this._block, s = this._blockSize, u = n.length, f = this._len, h = 0; h < u; ) {
|
|
2125
|
+
for (var a = f % s, w = Math.min(u - h, s - a), y = 0; y < w; y++)
|
|
2126
|
+
o[a + y] = n[h + y];
|
|
2127
|
+
f += w, h += w, f % s === 0 && this._update(o);
|
|
2128
2128
|
}
|
|
2129
|
-
return this._len +=
|
|
2129
|
+
return this._len += u, this;
|
|
2130
2130
|
};
|
|
2131
2131
|
at.prototype.digest = function(n) {
|
|
2132
2132
|
var r = this._len % this._blockSize;
|
|
@@ -2135,59 +2135,59 @@ at.prototype.digest = function(n) {
|
|
|
2135
2135
|
if (o <= 4294967295)
|
|
2136
2136
|
this._block.writeUInt32BE(o, this._blockSize - 4);
|
|
2137
2137
|
else {
|
|
2138
|
-
var s = (o & 4294967295) >>> 0,
|
|
2139
|
-
this._block.writeUInt32BE(
|
|
2138
|
+
var s = (o & 4294967295) >>> 0, u = (o - s) / 4294967296;
|
|
2139
|
+
this._block.writeUInt32BE(u, this._blockSize - 8), this._block.writeUInt32BE(s, this._blockSize - 4);
|
|
2140
2140
|
}
|
|
2141
2141
|
this._update(this._block);
|
|
2142
|
-
var
|
|
2143
|
-
return n ?
|
|
2142
|
+
var f = this._hash();
|
|
2143
|
+
return n ? f.toString(n) : f;
|
|
2144
2144
|
};
|
|
2145
2145
|
at.prototype._update = function() {
|
|
2146
2146
|
throw new Error("_update must be implemented by subclass");
|
|
2147
2147
|
};
|
|
2148
|
-
var
|
|
2148
|
+
var lr = at, pr = nr, Jt = lr, dr = Vt.Buffer, wr = [
|
|
2149
2149
|
1518500249,
|
|
2150
2150
|
1859775393,
|
|
2151
2151
|
-1894007588,
|
|
2152
2152
|
-899497514
|
|
2153
|
-
],
|
|
2153
|
+
], yr = new Array(80);
|
|
2154
2154
|
function rt() {
|
|
2155
|
-
this.init(), this._w =
|
|
2155
|
+
this.init(), this._w = yr, Jt.call(this, 64, 56);
|
|
2156
2156
|
}
|
|
2157
|
-
|
|
2157
|
+
pr(rt, Jt);
|
|
2158
2158
|
rt.prototype.init = function() {
|
|
2159
2159
|
return this._a = 1732584193, this._b = 4023233417, this._c = 2562383102, this._d = 271733878, this._e = 3285377520, this;
|
|
2160
2160
|
};
|
|
2161
|
-
function
|
|
2161
|
+
function gr(n) {
|
|
2162
2162
|
return n << 1 | n >>> 31;
|
|
2163
2163
|
}
|
|
2164
|
-
function
|
|
2164
|
+
function mr(n) {
|
|
2165
2165
|
return n << 5 | n >>> 27;
|
|
2166
2166
|
}
|
|
2167
|
-
function
|
|
2167
|
+
function br(n) {
|
|
2168
2168
|
return n << 30 | n >>> 2;
|
|
2169
2169
|
}
|
|
2170
|
-
function
|
|
2170
|
+
function xr(n, r, o, s) {
|
|
2171
2171
|
return n === 0 ? r & o | ~r & s : n === 2 ? r & o | r & s | o & s : r ^ o ^ s;
|
|
2172
2172
|
}
|
|
2173
2173
|
rt.prototype._update = function(n) {
|
|
2174
|
-
for (var r = this._w, o = this._a | 0, s = this._b | 0,
|
|
2175
|
-
r[
|
|
2176
|
-
for (;
|
|
2177
|
-
r[
|
|
2174
|
+
for (var r = this._w, o = this._a | 0, s = this._b | 0, u = this._c | 0, f = this._d | 0, h = this._e | 0, a = 0; a < 16; ++a)
|
|
2175
|
+
r[a] = n.readInt32BE(a * 4);
|
|
2176
|
+
for (; a < 80; ++a)
|
|
2177
|
+
r[a] = gr(r[a - 3] ^ r[a - 8] ^ r[a - 14] ^ r[a - 16]);
|
|
2178
2178
|
for (var w = 0; w < 80; ++w) {
|
|
2179
|
-
var y = ~~(w / 20), g =
|
|
2180
|
-
h =
|
|
2179
|
+
var y = ~~(w / 20), g = mr(o) + xr(y, s, u, f) + h + r[w] + wr[y] | 0;
|
|
2180
|
+
h = f, f = u, u = br(s), s = o, o = g;
|
|
2181
2181
|
}
|
|
2182
|
-
this._a = o + this._a | 0, this._b = s + this._b | 0, this._c =
|
|
2182
|
+
this._a = o + this._a | 0, this._b = s + this._b | 0, this._c = u + this._c | 0, this._d = f + this._d | 0, this._e = h + this._e | 0;
|
|
2183
2183
|
};
|
|
2184
2184
|
rt.prototype._hash = function() {
|
|
2185
|
-
var n =
|
|
2185
|
+
var n = dr.allocUnsafe(20);
|
|
2186
2186
|
return n.writeInt32BE(this._a | 0, 0), n.writeInt32BE(this._b | 0, 4), n.writeInt32BE(this._c | 0, 8), n.writeInt32BE(this._d | 0, 12), n.writeInt32BE(this._e | 0, 16), n;
|
|
2187
2187
|
};
|
|
2188
|
-
var
|
|
2189
|
-
const
|
|
2190
|
-
function
|
|
2188
|
+
var Br = rt;
|
|
2189
|
+
const Er = /* @__PURE__ */ rr(Br);
|
|
2190
|
+
function Ir(n) {
|
|
2191
2191
|
let r = "";
|
|
2192
2192
|
for (const o of new Uint8Array(n))
|
|
2193
2193
|
o < 16 && (r += "0"), r += o.toString(16);
|
|
@@ -2195,16 +2195,16 @@ function _r(n) {
|
|
|
2195
2195
|
}
|
|
2196
2196
|
let dt = null;
|
|
2197
2197
|
async function jt(n) {
|
|
2198
|
-
return dt === null && (dt = await
|
|
2198
|
+
return dt === null && (dt = await Ar()), dt ? Xt(n) : _r(n);
|
|
2199
2199
|
}
|
|
2200
|
-
function
|
|
2201
|
-
return new
|
|
2200
|
+
function _r(n) {
|
|
2201
|
+
return new Er().update(n).digest("hex");
|
|
2202
2202
|
}
|
|
2203
2203
|
async function Xt(n) {
|
|
2204
2204
|
const r = await crypto.subtle.digest("SHA-1", n);
|
|
2205
|
-
return
|
|
2205
|
+
return Ir(r);
|
|
2206
2206
|
}
|
|
2207
|
-
async function
|
|
2207
|
+
async function Ar() {
|
|
2208
2208
|
try {
|
|
2209
2209
|
if (await Xt(new Uint8Array([])) === "da39a3ee5e6b4b0d3255bfef95601890afd80709")
|
|
2210
2210
|
return !0;
|
|
@@ -2212,21 +2212,21 @@ async function Fr() {
|
|
|
2212
2212
|
}
|
|
2213
2213
|
return !1;
|
|
2214
2214
|
}
|
|
2215
|
-
function
|
|
2215
|
+
function Fr(n) {
|
|
2216
2216
|
const r = [];
|
|
2217
2217
|
let o = 0, s = 0;
|
|
2218
2218
|
do {
|
|
2219
2219
|
o = n.readUInt8();
|
|
2220
|
-
const
|
|
2221
|
-
r.push(
|
|
2220
|
+
const u = o & 127;
|
|
2221
|
+
r.push(u), s = o & 128;
|
|
2222
2222
|
} while (s);
|
|
2223
|
-
return r.reduce((
|
|
2223
|
+
return r.reduce((u, f) => u + 1 << 7 | f, -1);
|
|
2224
2224
|
}
|
|
2225
|
-
function
|
|
2226
|
-
let o = r, s = 4,
|
|
2225
|
+
function Ur(n, r) {
|
|
2226
|
+
let o = r, s = 4, u = null;
|
|
2227
2227
|
do
|
|
2228
|
-
|
|
2229
|
-
while (
|
|
2228
|
+
u = n.readUInt8(), o |= (u & 127) << s, s += 7;
|
|
2229
|
+
while (u & 128);
|
|
2230
2230
|
return o;
|
|
2231
2231
|
}
|
|
2232
2232
|
class Q {
|
|
@@ -2237,28 +2237,28 @@ class Q {
|
|
|
2237
2237
|
const s = new z(r);
|
|
2238
2238
|
if (s.slice(4).toString("hex") !== "ff744f63")
|
|
2239
2239
|
return;
|
|
2240
|
-
const
|
|
2241
|
-
if (
|
|
2240
|
+
const f = s.readUInt32BE();
|
|
2241
|
+
if (f !== 2)
|
|
2242
2242
|
throw new _(
|
|
2243
|
-
`Unable to read version ${
|
|
2243
|
+
`Unable to read version ${f} packfile IDX. (Only version 2 supported)`
|
|
2244
2244
|
);
|
|
2245
2245
|
if (r.byteLength > 2048 * 1024 * 1024)
|
|
2246
2246
|
throw new _(
|
|
2247
2247
|
"To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size."
|
|
2248
2248
|
);
|
|
2249
2249
|
s.seek(s.tell() + 4 * 255);
|
|
2250
|
-
const h = s.readUInt32BE(),
|
|
2250
|
+
const h = s.readUInt32BE(), a = [];
|
|
2251
2251
|
for (let g = 0; g < h; g++) {
|
|
2252
2252
|
const m = s.slice(20).toString("hex");
|
|
2253
|
-
|
|
2253
|
+
a[g] = m;
|
|
2254
2254
|
}
|
|
2255
2255
|
s.seek(s.tell() + 4 * h);
|
|
2256
2256
|
const w = /* @__PURE__ */ new Map();
|
|
2257
2257
|
for (let g = 0; g < h; g++)
|
|
2258
|
-
w.set(
|
|
2258
|
+
w.set(a[g], s.readUInt32BE());
|
|
2259
2259
|
const y = s.slice(20).toString("hex");
|
|
2260
2260
|
return new Q({
|
|
2261
|
-
hashes:
|
|
2261
|
+
hashes: a,
|
|
2262
2262
|
crcs: {},
|
|
2263
2263
|
offsets: w,
|
|
2264
2264
|
packfileSha: y,
|
|
@@ -2266,72 +2266,72 @@ class Q {
|
|
|
2266
2266
|
});
|
|
2267
2267
|
}
|
|
2268
2268
|
static async fromPack({ pack: r, getExternalRefDelta: o, onProgress: s }) {
|
|
2269
|
-
const
|
|
2269
|
+
const u = {
|
|
2270
2270
|
1: "commit",
|
|
2271
2271
|
2: "tree",
|
|
2272
2272
|
3: "blob",
|
|
2273
2273
|
4: "tag",
|
|
2274
2274
|
6: "ofs-delta",
|
|
2275
2275
|
7: "ref-delta"
|
|
2276
|
-
},
|
|
2276
|
+
}, f = {}, h = r.slice(-20).toString("hex"), a = [], w = {}, y = /* @__PURE__ */ new Map();
|
|
2277
2277
|
let g = null, m = null;
|
|
2278
|
-
await
|
|
2279
|
-
g === null && (g =
|
|
2278
|
+
await Xe([r], async ({ data: N, type: U, reference: M, offset: $, num: v }) => {
|
|
2279
|
+
g === null && (g = v);
|
|
2280
2280
|
const R = Math.floor(
|
|
2281
|
-
(g -
|
|
2281
|
+
(g - v) * 100 / g
|
|
2282
2282
|
);
|
|
2283
2283
|
R !== m && s && await s({
|
|
2284
2284
|
phase: "Receiving objects",
|
|
2285
|
-
loaded: g -
|
|
2285
|
+
loaded: g - v,
|
|
2286
2286
|
total: g
|
|
2287
|
-
}), m = R, U =
|
|
2287
|
+
}), m = R, U = u[U], ["commit", "tree", "blob", "tag"].includes(U) ? f[$] = {
|
|
2288
2288
|
type: U,
|
|
2289
2289
|
offset: $
|
|
2290
|
-
} : U === "ofs-delta" ?
|
|
2290
|
+
} : U === "ofs-delta" ? f[$] = {
|
|
2291
2291
|
type: U,
|
|
2292
2292
|
offset: $
|
|
2293
|
-
} : U === "ref-delta" && (
|
|
2293
|
+
} : U === "ref-delta" && (f[$] = {
|
|
2294
2294
|
type: U,
|
|
2295
2295
|
offset: $
|
|
2296
2296
|
});
|
|
2297
2297
|
});
|
|
2298
|
-
const b = Object.keys(
|
|
2299
|
-
for (const [
|
|
2300
|
-
const M =
|
|
2301
|
-
$.end = M, $.crc =
|
|
2298
|
+
const b = Object.keys(f).map(Number);
|
|
2299
|
+
for (const [N, U] of b.entries()) {
|
|
2300
|
+
const M = N + 1 === b.length ? r.byteLength - 20 : b[N + 1], $ = f[U], v = _e.buf(r.slice(U, M)) >>> 0;
|
|
2301
|
+
$.end = M, $.crc = v;
|
|
2302
2302
|
}
|
|
2303
2303
|
const B = new Q({
|
|
2304
2304
|
pack: Promise.resolve(r),
|
|
2305
2305
|
packfileSha: h,
|
|
2306
2306
|
crcs: w,
|
|
2307
|
-
hashes:
|
|
2307
|
+
hashes: a,
|
|
2308
2308
|
offsets: y,
|
|
2309
2309
|
getExternalRefDelta: o
|
|
2310
2310
|
});
|
|
2311
2311
|
m = null;
|
|
2312
2312
|
let T = 0;
|
|
2313
2313
|
const L = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
2314
|
-
for (let
|
|
2315
|
-
|
|
2314
|
+
for (let N in f) {
|
|
2315
|
+
N = Number(N);
|
|
2316
2316
|
const U = Math.floor(T * 100 / g);
|
|
2317
2317
|
U !== m && s && await s({
|
|
2318
2318
|
phase: "Resolving deltas",
|
|
2319
2319
|
loaded: T,
|
|
2320
2320
|
total: g
|
|
2321
2321
|
}), T++, m = U;
|
|
2322
|
-
const M =
|
|
2322
|
+
const M = f[N];
|
|
2323
2323
|
if (!M.oid)
|
|
2324
2324
|
try {
|
|
2325
2325
|
B.readDepth = 0, B.externalReadDepth = 0;
|
|
2326
|
-
const { type: $, object:
|
|
2326
|
+
const { type: $, object: v } = await B.readSlice({ start: N });
|
|
2327
2327
|
L[B.readDepth] += 1;
|
|
2328
|
-
const R = await jt(
|
|
2329
|
-
M.oid = R,
|
|
2328
|
+
const R = await jt(Ke.wrap({ type: $, object: v }));
|
|
2329
|
+
M.oid = R, a.push(R), y.set(R, N), w[R] = M.crc;
|
|
2330
2330
|
} catch {
|
|
2331
2331
|
continue;
|
|
2332
2332
|
}
|
|
2333
2333
|
}
|
|
2334
|
-
return
|
|
2334
|
+
return a.sort(), B;
|
|
2335
2335
|
}
|
|
2336
2336
|
async toBuffer() {
|
|
2337
2337
|
const r = [], o = (y, g) => {
|
|
@@ -2348,16 +2348,16 @@ class Q {
|
|
|
2348
2348
|
r.push(s.buffer);
|
|
2349
2349
|
for (const y of this.hashes)
|
|
2350
2350
|
o(y, "hex");
|
|
2351
|
-
const f = new z(Buffer.alloc(this.hashes.length * 4));
|
|
2352
|
-
for (const y of this.hashes)
|
|
2353
|
-
f.writeUInt32BE(this.crcs[y]);
|
|
2354
|
-
r.push(f.buffer);
|
|
2355
2351
|
const u = new z(Buffer.alloc(this.hashes.length * 4));
|
|
2356
2352
|
for (const y of this.hashes)
|
|
2357
|
-
u.writeUInt32BE(this.
|
|
2358
|
-
r.push(u.buffer)
|
|
2359
|
-
const
|
|
2360
|
-
|
|
2353
|
+
u.writeUInt32BE(this.crcs[y]);
|
|
2354
|
+
r.push(u.buffer);
|
|
2355
|
+
const f = new z(Buffer.alloc(this.hashes.length * 4));
|
|
2356
|
+
for (const y of this.hashes)
|
|
2357
|
+
f.writeUInt32BE(this.offsets.get(y));
|
|
2358
|
+
r.push(f.buffer), o(this.packfileSha, "hex");
|
|
2359
|
+
const h = Buffer.concat(r), a = await jt(h), w = Buffer.alloc(20);
|
|
2360
|
+
return w.write(a, "hex"), Buffer.concat([h, w]);
|
|
2361
2361
|
}
|
|
2362
2362
|
async load({ pack: r }) {
|
|
2363
2363
|
this.pack = r;
|
|
@@ -2390,28 +2390,28 @@ class Q {
|
|
|
2390
2390
|
throw new _(
|
|
2391
2391
|
"Tried to read from a GitPackIndex with no packfile loaded into memory"
|
|
2392
2392
|
);
|
|
2393
|
-
const s = (await this.pack).slice(r),
|
|
2394
|
-
let
|
|
2395
|
-
if (
|
|
2393
|
+
const s = (await this.pack).slice(r), u = new z(s), f = u.readUInt8(), h = f & 112;
|
|
2394
|
+
let a = o[h];
|
|
2395
|
+
if (a === void 0)
|
|
2396
2396
|
throw new _("Unrecognized type: 0b" + h.toString(2));
|
|
2397
|
-
const w =
|
|
2397
|
+
const w = f & 15;
|
|
2398
2398
|
let y = w;
|
|
2399
|
-
|
|
2399
|
+
f & 128 && (y = Ur(u, w));
|
|
2400
2400
|
let m = null, b = null;
|
|
2401
|
-
if (
|
|
2402
|
-
const T =
|
|
2403
|
-
({ object: m, type:
|
|
2401
|
+
if (a === "ofs_delta") {
|
|
2402
|
+
const T = Fr(u), L = r - T;
|
|
2403
|
+
({ object: m, type: a } = await this.readSlice({ start: L }));
|
|
2404
2404
|
}
|
|
2405
|
-
if (
|
|
2406
|
-
const T =
|
|
2407
|
-
({ object: m, type:
|
|
2405
|
+
if (a === "ref_delta") {
|
|
2406
|
+
const T = u.slice(20).toString("hex");
|
|
2407
|
+
({ object: m, type: a } = await this.read({ oid: T }));
|
|
2408
2408
|
}
|
|
2409
|
-
const B = s.slice(
|
|
2410
|
-
if (b = Buffer.from(await
|
|
2409
|
+
const B = s.slice(u.tell());
|
|
2410
|
+
if (b = Buffer.from(await tr(B)), b.byteLength !== y)
|
|
2411
2411
|
throw new _(
|
|
2412
2412
|
`Packfile told us object would have length ${y} but it had length ${b.byteLength}`
|
|
2413
2413
|
);
|
|
2414
|
-
return m && (b = Buffer.from(
|
|
2414
|
+
return m && (b = Buffer.from(Je(b, m))), this.readDepth > 3 && (this.offsetCache[r] = { type: a, object: b }), { type: a, format: "content", object: b };
|
|
2415
2415
|
}
|
|
2416
2416
|
}
|
|
2417
2417
|
class tt extends J {
|
|
@@ -2430,18 +2430,18 @@ class ct extends J {
|
|
|
2430
2430
|
* @param {'blob'|'commit'|'tag'|'tree'} expected
|
|
2431
2431
|
* @param {string} [filepath]
|
|
2432
2432
|
*/
|
|
2433
|
-
constructor(r, o, s,
|
|
2433
|
+
constructor(r, o, s, u) {
|
|
2434
2434
|
super(
|
|
2435
|
-
`Object ${r} ${
|
|
2436
|
-
), this.code = this.name = ct.code, this.data = { oid: r, actual: o, expected: s, filepath:
|
|
2435
|
+
`Object ${r} ${u ? `at ${u}` : ""}was anticipated to be a ${s} but it is a ${o}.`
|
|
2436
|
+
), this.code = this.name = ct.code, this.data = { oid: r, actual: o, expected: s, filepath: u };
|
|
2437
2437
|
}
|
|
2438
2438
|
}
|
|
2439
2439
|
ct.code = "ObjectTypeError";
|
|
2440
2440
|
async function Zt(n, r) {
|
|
2441
|
-
const o =
|
|
2441
|
+
const o = Ht(n);
|
|
2442
2442
|
for (; ; ) {
|
|
2443
|
-
const { value: s, done:
|
|
2444
|
-
if (s && await r(s),
|
|
2443
|
+
const { value: s, done: u } = await o.next();
|
|
2444
|
+
if (s && await r(s), u)
|
|
2445
2445
|
break;
|
|
2446
2446
|
}
|
|
2447
2447
|
o.return && o.return();
|
|
@@ -2449,13 +2449,13 @@ async function Zt(n, r) {
|
|
|
2449
2449
|
async function et(n) {
|
|
2450
2450
|
let r = 0;
|
|
2451
2451
|
const o = [];
|
|
2452
|
-
await Zt(n, (
|
|
2453
|
-
o.push(
|
|
2452
|
+
await Zt(n, (f) => {
|
|
2453
|
+
o.push(f), r += f.byteLength;
|
|
2454
2454
|
});
|
|
2455
2455
|
const s = new Uint8Array(r);
|
|
2456
|
-
let
|
|
2457
|
-
for (const
|
|
2458
|
-
s.set(
|
|
2456
|
+
let u = 0;
|
|
2457
|
+
for (const f of o)
|
|
2458
|
+
s.set(f, u), u += f.byteLength;
|
|
2459
2459
|
return s;
|
|
2460
2460
|
}
|
|
2461
2461
|
class wt {
|
|
@@ -2494,39 +2494,39 @@ class wt {
|
|
|
2494
2494
|
});
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
|
-
class
|
|
2497
|
+
class Sr {
|
|
2498
2498
|
static demux(r) {
|
|
2499
|
-
const o = k.streamReader(r), s = new wt(),
|
|
2500
|
-
const
|
|
2501
|
-
if (
|
|
2499
|
+
const o = k.streamReader(r), s = new wt(), u = new wt(), f = new wt(), h = async function() {
|
|
2500
|
+
const a = await o();
|
|
2501
|
+
if (a === null)
|
|
2502
2502
|
return h();
|
|
2503
|
-
if (
|
|
2504
|
-
s.end(),
|
|
2503
|
+
if (a === !0) {
|
|
2504
|
+
s.end(), f.end(), r.error ? u.destroy(r.error) : u.end();
|
|
2505
2505
|
return;
|
|
2506
2506
|
}
|
|
2507
|
-
switch (
|
|
2507
|
+
switch (a[0]) {
|
|
2508
2508
|
case 1: {
|
|
2509
|
-
|
|
2509
|
+
u.write(a.slice(1));
|
|
2510
2510
|
break;
|
|
2511
2511
|
}
|
|
2512
2512
|
case 2: {
|
|
2513
|
-
|
|
2513
|
+
f.write(a.slice(1));
|
|
2514
2514
|
break;
|
|
2515
2515
|
}
|
|
2516
2516
|
case 3: {
|
|
2517
|
-
const w =
|
|
2518
|
-
|
|
2517
|
+
const w = a.slice(1);
|
|
2518
|
+
f.write(w), s.end(), f.end(), u.destroy(new Error(w.toString("utf8")));
|
|
2519
2519
|
return;
|
|
2520
2520
|
}
|
|
2521
2521
|
default:
|
|
2522
|
-
s.write(
|
|
2522
|
+
s.write(a);
|
|
2523
2523
|
}
|
|
2524
2524
|
h();
|
|
2525
2525
|
};
|
|
2526
2526
|
return h(), {
|
|
2527
2527
|
packetlines: s,
|
|
2528
|
-
packfile:
|
|
2529
|
-
progress:
|
|
2528
|
+
packfile: u,
|
|
2529
|
+
progress: f
|
|
2530
2530
|
};
|
|
2531
2531
|
}
|
|
2532
2532
|
// static mux ({
|
|
@@ -2598,49 +2598,69 @@ class kr {
|
|
|
2598
2598
|
// }
|
|
2599
2599
|
}
|
|
2600
2600
|
async function Qt(n) {
|
|
2601
|
-
const { packetlines: r, packfile: o, progress: s } =
|
|
2602
|
-
let
|
|
2601
|
+
const { packetlines: r, packfile: o, progress: s } = Sr.demux(n), u = [], f = [], h = [];
|
|
2602
|
+
let a = !1, w = !1;
|
|
2603
2603
|
return new Promise((y, g) => {
|
|
2604
2604
|
Zt(r, (m) => {
|
|
2605
2605
|
const b = m.toString("utf8").trim();
|
|
2606
2606
|
if (b.startsWith("shallow")) {
|
|
2607
2607
|
const B = b.slice(-41).trim();
|
|
2608
|
-
B.length !== 40 && g(new tt(B)),
|
|
2608
|
+
B.length !== 40 && g(new tt(B)), u.push(B);
|
|
2609
2609
|
} else if (b.startsWith("unshallow")) {
|
|
2610
2610
|
const B = b.slice(-41).trim();
|
|
2611
|
-
B.length !== 40 && g(new tt(B)),
|
|
2611
|
+
B.length !== 40 && g(new tt(B)), f.push(B);
|
|
2612
2612
|
} else if (b.startsWith("ACK")) {
|
|
2613
2613
|
const [, B, T] = b.split(" ");
|
|
2614
2614
|
h.push({ oid: B, status: T }), T || (w = !0);
|
|
2615
2615
|
} else
|
|
2616
|
-
b.startsWith("NAK") ? (
|
|
2617
|
-
w && (n.error ? g(n.error) : y({ shallows:
|
|
2616
|
+
b.startsWith("NAK") ? (a = !0, w = !0) : (w = !0, a = !0);
|
|
2617
|
+
w && (n.error ? g(n.error) : y({ shallows: u, unshallows: f, acks: h, nak: a, packfile: o, progress: s }));
|
|
2618
2618
|
}).finally(() => {
|
|
2619
|
-
w || (n.error ? g(n.error) : y({ shallows:
|
|
2619
|
+
w || (n.error ? g(n.error) : y({ shallows: u, unshallows: f, acks: h, nak: a, packfile: o, progress: s }));
|
|
2620
2620
|
});
|
|
2621
2621
|
});
|
|
2622
2622
|
}
|
|
2623
|
-
typeof window < "u" && (window.Buffer =
|
|
2623
|
+
typeof window < "u" && (window.Buffer = H.Buffer);
|
|
2624
2624
|
async function Xr(n, r, o) {
|
|
2625
|
-
const
|
|
2625
|
+
const s = await ee(n, r), u = await $r(s, r, o), f = await Rr(
|
|
2626
2626
|
n,
|
|
2627
|
-
o.map((
|
|
2628
|
-
),
|
|
2627
|
+
o.map((a) => u[a].oid)
|
|
2628
|
+
), h = {};
|
|
2629
2629
|
return await Promise.all(
|
|
2630
|
-
o.map(async (
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2630
|
+
o.map(async (a) => {
|
|
2631
|
+
h[a] = await re(
|
|
2632
|
+
f,
|
|
2633
|
+
u[a].oid
|
|
2634
2634
|
);
|
|
2635
2635
|
})
|
|
2636
|
-
),
|
|
2636
|
+
), h;
|
|
2637
2637
|
}
|
|
2638
2638
|
async function Zr(n, r) {
|
|
2639
|
-
const o = await ee(n, r);
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2639
|
+
const o = await ee(n, r), s = await Tr(o, r);
|
|
2640
|
+
return s != null && s.object ? te(s) : [];
|
|
2641
|
+
}
|
|
2642
|
+
async function Qr(n, r) {
|
|
2643
|
+
switch ((r.type === "infer" || r.type === void 0) && (["", "HEAD"].includes(r.value) ? r = {
|
|
2644
|
+
value: r.value,
|
|
2645
|
+
type: "refname"
|
|
2646
|
+
} : typeof r.value == "string" && r.value.length === 40 && (r = {
|
|
2647
|
+
value: r.value,
|
|
2648
|
+
type: "commit"
|
|
2649
|
+
})), r.type === "branch" && (r = {
|
|
2650
|
+
value: `refs/heads/${r.value}`,
|
|
2651
|
+
type: "refname"
|
|
2652
|
+
}), r.type) {
|
|
2653
|
+
case "commit":
|
|
2654
|
+
return r.value;
|
|
2655
|
+
case "refname": {
|
|
2656
|
+
const o = await kr(n, r.value);
|
|
2657
|
+
if (!(r.value in o))
|
|
2658
|
+
throw new Error(`Branch ${r.value} not found`);
|
|
2659
|
+
return o[r.value];
|
|
2660
|
+
}
|
|
2661
|
+
default:
|
|
2662
|
+
throw new Error(`Invalid ref type: ${r.type}`);
|
|
2663
|
+
}
|
|
2644
2664
|
}
|
|
2645
2665
|
function te(n) {
|
|
2646
2666
|
return n.object.map((r) => {
|
|
@@ -2657,8 +2677,8 @@ function te(n) {
|
|
|
2657
2677
|
};
|
|
2658
2678
|
}).filter((r) => !!(r != null && r.name));
|
|
2659
2679
|
}
|
|
2660
|
-
async function
|
|
2661
|
-
const o =
|
|
2680
|
+
async function kr(n, r) {
|
|
2681
|
+
const o = H.Buffer.from(
|
|
2662
2682
|
await et([
|
|
2663
2683
|
k.encode(`command=ls-refs
|
|
2664
2684
|
`),
|
|
@@ -2682,15 +2702,15 @@ async function ee(n, r) {
|
|
|
2682
2702
|
"Git-Protocol": "version=2"
|
|
2683
2703
|
},
|
|
2684
2704
|
body: o
|
|
2685
|
-
}),
|
|
2686
|
-
for await (const
|
|
2687
|
-
const h =
|
|
2688
|
-
|
|
2705
|
+
}), u = {};
|
|
2706
|
+
for await (const f of Cr(s)) {
|
|
2707
|
+
const h = f.indexOf(" "), a = f.slice(0, h), w = f.slice(h + 1, f.length - 1);
|
|
2708
|
+
u[w] = a;
|
|
2689
2709
|
}
|
|
2690
|
-
return
|
|
2710
|
+
return u;
|
|
2691
2711
|
}
|
|
2692
|
-
async function
|
|
2693
|
-
const o =
|
|
2712
|
+
async function ee(n, r) {
|
|
2713
|
+
const o = H.Buffer.from(
|
|
2694
2714
|
await et([
|
|
2695
2715
|
k.encode(
|
|
2696
2716
|
`want ${r} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3 filter
|
|
@@ -2716,25 +2736,25 @@ async function re(n, r) {
|
|
|
2716
2736
|
"Content-Length": `${o.length}`
|
|
2717
2737
|
},
|
|
2718
2738
|
body: o
|
|
2719
|
-
}),
|
|
2739
|
+
}), u = ne(s.body), f = await Qt(u), h = H.Buffer.from(await et(f.packfile)), a = await Q.fromPack({
|
|
2720
2740
|
pack: h
|
|
2721
|
-
}), w =
|
|
2722
|
-
return
|
|
2741
|
+
}), w = a.read;
|
|
2742
|
+
return a.read = async function({ oid: y, ...g }) {
|
|
2723
2743
|
const m = await w.call(this, { oid: y, ...g });
|
|
2724
2744
|
return m.oid = y, m;
|
|
2725
|
-
},
|
|
2745
|
+
}, a;
|
|
2726
2746
|
}
|
|
2727
2747
|
async function Tr(n, r) {
|
|
2728
2748
|
const o = await n.read({
|
|
2729
2749
|
oid: r
|
|
2730
2750
|
});
|
|
2731
2751
|
W(o);
|
|
2732
|
-
const s = await n.read({ oid: o.object.tree }),
|
|
2733
|
-
for (;
|
|
2734
|
-
const
|
|
2735
|
-
if (W(h),
|
|
2736
|
-
for (const
|
|
2737
|
-
|
|
2752
|
+
const s = await n.read({ oid: o.object.tree }), u = [s];
|
|
2753
|
+
for (; u.length > 0; ) {
|
|
2754
|
+
const f = u.pop(), h = await n.read({ oid: f.oid });
|
|
2755
|
+
if (W(h), f.object = h.object, h.type === "tree")
|
|
2756
|
+
for (const a of h.object)
|
|
2757
|
+
a.type === "tree" && u.push(a);
|
|
2738
2758
|
}
|
|
2739
2759
|
return s;
|
|
2740
2760
|
}
|
|
@@ -2743,22 +2763,22 @@ async function $r(n, r, o) {
|
|
|
2743
2763
|
oid: r
|
|
2744
2764
|
});
|
|
2745
2765
|
W(s);
|
|
2746
|
-
const
|
|
2747
|
-
W(
|
|
2748
|
-
const
|
|
2766
|
+
const u = await n.read({ oid: s.object.tree });
|
|
2767
|
+
W(u);
|
|
2768
|
+
const f = {};
|
|
2749
2769
|
for (const h of o) {
|
|
2750
|
-
let
|
|
2770
|
+
let a = u;
|
|
2751
2771
|
const w = h.split("/");
|
|
2752
2772
|
for (const y of w) {
|
|
2753
|
-
if (
|
|
2773
|
+
if (a.type !== "tree")
|
|
2754
2774
|
throw new Error(`Path not found in the repo: ${h}`);
|
|
2755
2775
|
let g = !1;
|
|
2756
|
-
for (const m of
|
|
2776
|
+
for (const m of a.object)
|
|
2757
2777
|
if (m.path === y) {
|
|
2758
2778
|
try {
|
|
2759
|
-
|
|
2779
|
+
a = await n.read({ oid: m.oid }), W(a);
|
|
2760
2780
|
} catch {
|
|
2761
|
-
|
|
2781
|
+
a = m;
|
|
2762
2782
|
}
|
|
2763
2783
|
g = !0;
|
|
2764
2784
|
break;
|
|
@@ -2766,16 +2786,16 @@ async function $r(n, r, o) {
|
|
|
2766
2786
|
if (!g)
|
|
2767
2787
|
throw new Error(`Path not found in the repo: ${h}`);
|
|
2768
2788
|
}
|
|
2769
|
-
|
|
2789
|
+
f[h] = a;
|
|
2770
2790
|
}
|
|
2771
|
-
return
|
|
2791
|
+
return f;
|
|
2772
2792
|
}
|
|
2773
2793
|
async function Rr(n, r) {
|
|
2774
|
-
const o =
|
|
2794
|
+
const o = H.Buffer.from(
|
|
2775
2795
|
await et([
|
|
2776
2796
|
...r.map(
|
|
2777
|
-
(
|
|
2778
|
-
`want ${
|
|
2797
|
+
(a) => k.encode(
|
|
2798
|
+
`want ${a} multi_ack_detailed no-done side-band-64k thin-pack ofs-delta agent=git/2.37.3
|
|
2779
2799
|
`
|
|
2780
2800
|
)
|
|
2781
2801
|
),
|
|
@@ -2791,26 +2811,26 @@ async function Rr(n, r) {
|
|
|
2791
2811
|
"Content-Length": `${o.length}`
|
|
2792
2812
|
},
|
|
2793
2813
|
body: o
|
|
2794
|
-
}),
|
|
2814
|
+
}), u = ne(s.body), f = await Qt(u), h = H.Buffer.from(await et(f.packfile));
|
|
2795
2815
|
return await Q.fromPack({
|
|
2796
2816
|
pack: h
|
|
2797
2817
|
});
|
|
2798
2818
|
}
|
|
2799
|
-
async function
|
|
2819
|
+
async function re(n, r) {
|
|
2800
2820
|
const o = await n.read({ oid: r });
|
|
2801
2821
|
if (W(o), o.type === "blob")
|
|
2802
2822
|
return o.object;
|
|
2803
2823
|
const s = {};
|
|
2804
|
-
for (const { path:
|
|
2824
|
+
for (const { path: u, oid: f, type: h } of o.object)
|
|
2805
2825
|
if (h === "blob") {
|
|
2806
|
-
const
|
|
2807
|
-
W(
|
|
2826
|
+
const a = await n.read({ oid: f });
|
|
2827
|
+
W(a), s[u] = a.object;
|
|
2808
2828
|
} else
|
|
2809
|
-
h === "tree" && (s[
|
|
2829
|
+
h === "tree" && (s[u] = await re(n, f));
|
|
2810
2830
|
return s;
|
|
2811
2831
|
}
|
|
2812
2832
|
function W(n) {
|
|
2813
|
-
if (n.object instanceof
|
|
2833
|
+
if (n.object instanceof H.Buffer)
|
|
2814
2834
|
switch (n.type) {
|
|
2815
2835
|
case "commit":
|
|
2816
2836
|
n.object = O.from(n.object).parse();
|
|
@@ -2842,7 +2862,7 @@ async function* Cr(n) {
|
|
|
2842
2862
|
yield r.substring(o + 4, o + s), o += s;
|
|
2843
2863
|
}
|
|
2844
2864
|
}
|
|
2845
|
-
function
|
|
2865
|
+
function ne(n) {
|
|
2846
2866
|
if (n[Symbol.asyncIterator])
|
|
2847
2867
|
return n;
|
|
2848
2868
|
const r = n.getReader();
|
|
@@ -2858,7 +2878,7 @@ function ie(n) {
|
|
|
2858
2878
|
}
|
|
2859
2879
|
};
|
|
2860
2880
|
}
|
|
2861
|
-
function
|
|
2881
|
+
function tn(n, r) {
|
|
2862
2882
|
r = Mt(r);
|
|
2863
2883
|
const o = ["", ".", "/"].includes(r);
|
|
2864
2884
|
let s = n;
|
|
@@ -2866,9 +2886,9 @@ function Qr(n, r) {
|
|
|
2866
2886
|
r = "";
|
|
2867
2887
|
else {
|
|
2868
2888
|
const h = r.split("/");
|
|
2869
|
-
for (const
|
|
2889
|
+
for (const a of h) {
|
|
2870
2890
|
const w = s == null ? void 0 : s.find(
|
|
2871
|
-
(y) => y.name ===
|
|
2891
|
+
(y) => y.name === a
|
|
2872
2892
|
);
|
|
2873
2893
|
if ((w == null ? void 0 : w.type) === "folder")
|
|
2874
2894
|
s = w.children;
|
|
@@ -2876,40 +2896,45 @@ function Qr(n, r) {
|
|
|
2876
2896
|
return w ? [w.name] : [];
|
|
2877
2897
|
}
|
|
2878
2898
|
}
|
|
2879
|
-
const
|
|
2880
|
-
for (;
|
|
2881
|
-
const { tree: h, path:
|
|
2899
|
+
const u = [], f = [{ tree: s, path: r }];
|
|
2900
|
+
for (; f.length > 0; ) {
|
|
2901
|
+
const { tree: h, path: a } = f.pop();
|
|
2882
2902
|
for (const w of h) {
|
|
2883
|
-
const y = `${
|
|
2884
|
-
w.type === "folder" ?
|
|
2903
|
+
const y = `${a}${a ? "/" : ""}${w.name}`;
|
|
2904
|
+
w.type === "folder" ? f.push({
|
|
2885
2905
|
tree: w.children,
|
|
2886
2906
|
path: y
|
|
2887
|
-
}) :
|
|
2907
|
+
}) : u.push(y);
|
|
2888
2908
|
}
|
|
2889
2909
|
}
|
|
2890
|
-
return
|
|
2910
|
+
return u;
|
|
2911
|
+
}
|
|
2912
|
+
function en(n, r) {
|
|
2913
|
+
return n.startsWith(r) ? n.substring(r.length) : n;
|
|
2891
2914
|
}
|
|
2892
2915
|
export {
|
|
2893
2916
|
Yr as changeset,
|
|
2894
2917
|
Kr as clearContentsFromMountDevice,
|
|
2895
2918
|
jr as createClient,
|
|
2896
|
-
|
|
2897
|
-
|
|
2919
|
+
qr as createCommit,
|
|
2920
|
+
Gr as createOrUpdateBranch,
|
|
2898
2921
|
zr as createTree,
|
|
2899
2922
|
Ct as createTreeNode,
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2923
|
+
ke as createTreeNodes,
|
|
2924
|
+
Te as deleteFile,
|
|
2925
|
+
Ce as directoryHandleFromMountDevice,
|
|
2903
2926
|
Vr as directoryHandleToOpfsPath,
|
|
2904
2927
|
Lr as filesListToObject,
|
|
2905
|
-
|
|
2928
|
+
Hr as fork,
|
|
2906
2929
|
Mr as getArtifact,
|
|
2907
|
-
|
|
2930
|
+
Ae as getFilesFromDirectory,
|
|
2908
2931
|
Wr as iterateFiles,
|
|
2909
|
-
|
|
2932
|
+
tn as listDescendantFiles,
|
|
2910
2933
|
Zr as listGitFiles,
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
|
|
2934
|
+
kr as listGitRefs,
|
|
2935
|
+
vr as mayPush,
|
|
2936
|
+
Oe as opfsPathToDirectoryHandle,
|
|
2937
|
+
en as removePathPrefix,
|
|
2938
|
+
Qr as resolveCommitHash,
|
|
2914
2939
|
Xr as sparseCheckout
|
|
2915
2940
|
};
|