create-expo 5.0.0 → 5.0.1
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/build/205.index.js +54 -41
- package/build/{525.index.js → 223.index.js} +423 -326
- package/build/agent-files/AGENTS.md +41 -0
- package/build/agent-files/CLAUDE.md +1 -0
- package/build/index.js +1 -1
- package/package.json +9 -7
- package/template/agent-files/AGENTS.md +41 -0
- package/template/agent-files/CLAUDE.md +1 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
exports.id =
|
|
2
|
-
exports.ids = [
|
|
1
|
+
exports.id = 223;
|
|
2
|
+
exports.ids = [223];
|
|
3
3
|
exports.modules = {
|
|
4
4
|
|
|
5
5
|
/***/ 2671:
|
|
@@ -11726,12 +11726,12 @@ globstar while`,t,d,e,f,m),this.matchOne(t.slice(d),e.slice(f),s))return this.de
|
|
|
11726
11726
|
|
|
11727
11727
|
/***/ }),
|
|
11728
11728
|
|
|
11729
|
-
/***/
|
|
11729
|
+
/***/ 6378:
|
|
11730
11730
|
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
11731
11731
|
|
|
11732
11732
|
"use strict";
|
|
11733
11733
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
11734
|
-
/* harmony export */ Aq: () => (/* binding */
|
|
11734
|
+
/* harmony export */ Aq: () => (/* binding */ p),
|
|
11735
11735
|
/* harmony export */ PJ: () => (/* binding */ untar),
|
|
11736
11736
|
/* harmony export */ WT: () => (/* binding */ streamToAsyncIterable)
|
|
11737
11737
|
/* harmony export */ });
|
|
@@ -11744,15 +11744,18 @@ function createReadableStream(t) {
|
|
|
11744
11744
|
const {pull: n, cancel: i} = t;
|
|
11745
11745
|
if (n && i) {
|
|
11746
11746
|
let e;
|
|
11747
|
+
let a;
|
|
11747
11748
|
t.pull = function wrappedPull(t) {
|
|
11748
11749
|
return e = n(t);
|
|
11749
11750
|
};
|
|
11750
11751
|
t.cancel = function wrappedCancel() {
|
|
11751
|
-
if (null !=
|
|
11752
|
+
if (null != a) {
|
|
11753
|
+
return a;
|
|
11754
|
+
} else if (null != e) {
|
|
11752
11755
|
const settle = () => i();
|
|
11753
|
-
return Promise.resolve(e).then(settle, settle);
|
|
11756
|
+
return a = Promise.resolve(e).then(settle, settle);
|
|
11754
11757
|
}
|
|
11755
|
-
return i();
|
|
11758
|
+
return a = Promise.resolve(i());
|
|
11756
11759
|
};
|
|
11757
11760
|
}
|
|
11758
11761
|
const a = new ReadableStream(t, e);
|
|
@@ -11769,12 +11772,24 @@ function streamToAsyncIterable(e) {
|
|
|
11769
11772
|
if (!e[Symbol.asyncIterator]) {
|
|
11770
11773
|
return async function*() {
|
|
11771
11774
|
const t = e.getReader();
|
|
11772
|
-
|
|
11773
|
-
|
|
11774
|
-
|
|
11775
|
-
|
|
11775
|
+
let n = !1;
|
|
11776
|
+
try {
|
|
11777
|
+
while (1) {
|
|
11778
|
+
const e = await t.read();
|
|
11779
|
+
if (e.done) {
|
|
11780
|
+
n = !0;
|
|
11781
|
+
return e.value;
|
|
11782
|
+
}
|
|
11783
|
+
yield e.value;
|
|
11784
|
+
}
|
|
11785
|
+
} finally {
|
|
11786
|
+
try {
|
|
11787
|
+
if (!n) {
|
|
11788
|
+
await t.cancel();
|
|
11789
|
+
}
|
|
11790
|
+
} finally {
|
|
11791
|
+
t.releaseLock();
|
|
11776
11792
|
}
|
|
11777
|
-
yield e.value;
|
|
11778
11793
|
}
|
|
11779
11794
|
}();
|
|
11780
11795
|
} else {
|
|
@@ -11782,20 +11797,75 @@ function streamToAsyncIterable(e) {
|
|
|
11782
11797
|
}
|
|
11783
11798
|
}
|
|
11784
11799
|
|
|
11785
|
-
function
|
|
11786
|
-
if (
|
|
11787
|
-
|
|
11788
|
-
return async function read() {
|
|
11789
|
-
return await t.read();
|
|
11790
|
-
};
|
|
11800
|
+
async function* streamToSizedAsyncIterable(e, t, n) {
|
|
11801
|
+
if (null == t) {
|
|
11802
|
+
yield* streamToAsyncIterable(e);
|
|
11791
11803
|
} else {
|
|
11792
|
-
const
|
|
11793
|
-
|
|
11794
|
-
|
|
11795
|
-
|
|
11804
|
+
const i = e.getReader();
|
|
11805
|
+
let a = t;
|
|
11806
|
+
let r = !1;
|
|
11807
|
+
try {
|
|
11808
|
+
while (1) {
|
|
11809
|
+
const e = await i.read();
|
|
11810
|
+
if (e.done) {
|
|
11811
|
+
r = !0;
|
|
11812
|
+
break;
|
|
11813
|
+
}
|
|
11814
|
+
a -= e.value.byteLength;
|
|
11815
|
+
if (a < 0) {
|
|
11816
|
+
throw new Error(`${n} body exceeds declared size`);
|
|
11817
|
+
}
|
|
11818
|
+
yield e.value;
|
|
11819
|
+
}
|
|
11820
|
+
if (a > 0) {
|
|
11821
|
+
throw new Error(`${n} body is shorter than declared size`);
|
|
11822
|
+
}
|
|
11823
|
+
} finally {
|
|
11824
|
+
try {
|
|
11825
|
+
if (!r) {
|
|
11826
|
+
await i.cancel();
|
|
11827
|
+
}
|
|
11828
|
+
} finally {
|
|
11829
|
+
i.releaseLock();
|
|
11830
|
+
}
|
|
11831
|
+
}
|
|
11796
11832
|
}
|
|
11797
11833
|
}
|
|
11798
11834
|
|
|
11835
|
+
function streamLikeToIterator(e) {
|
|
11836
|
+
const t = "getReader" in e && "function" == typeof e.getReader ? streamToAsyncIterable(e) : e;
|
|
11837
|
+
const n = t[Symbol.asyncIterator] ? t[Symbol.asyncIterator]() : t[Symbol.iterator]();
|
|
11838
|
+
let i = !1;
|
|
11839
|
+
const a = {
|
|
11840
|
+
[Symbol.asyncIterator]: () => a,
|
|
11841
|
+
async next() {
|
|
11842
|
+
if (i) {
|
|
11843
|
+
return {
|
|
11844
|
+
done: !0,
|
|
11845
|
+
value: void 0
|
|
11846
|
+
};
|
|
11847
|
+
}
|
|
11848
|
+
const e = await n.next();
|
|
11849
|
+
i = !!e.done;
|
|
11850
|
+
return e.done ? {
|
|
11851
|
+
done: !0,
|
|
11852
|
+
value: void 0
|
|
11853
|
+
} : e;
|
|
11854
|
+
},
|
|
11855
|
+
async return() {
|
|
11856
|
+
if (!i) {
|
|
11857
|
+
i = !0;
|
|
11858
|
+
await (n.return?.());
|
|
11859
|
+
}
|
|
11860
|
+
return {
|
|
11861
|
+
done: !0,
|
|
11862
|
+
value: void 0
|
|
11863
|
+
};
|
|
11864
|
+
}
|
|
11865
|
+
};
|
|
11866
|
+
return a;
|
|
11867
|
+
}
|
|
11868
|
+
|
|
11799
11869
|
function iterableToStream(e, t) {
|
|
11800
11870
|
const n = t?.signal;
|
|
11801
11871
|
const i = new AbortController;
|
|
@@ -11941,6 +12011,9 @@ class ReadableStreamBlockReader {
|
|
|
11941
12011
|
this.block = new Uint8Array(t);
|
|
11942
12012
|
this.buffer = null;
|
|
11943
12013
|
}
|
|
12014
|
+
async close() {
|
|
12015
|
+
await this.next.return();
|
|
12016
|
+
}
|
|
11944
12017
|
async read() {
|
|
11945
12018
|
const {blockSize: e, block: t} = this;
|
|
11946
12019
|
let n = 0;
|
|
@@ -11962,7 +12035,7 @@ class ReadableStreamBlockReader {
|
|
|
11962
12035
|
}
|
|
11963
12036
|
}
|
|
11964
12037
|
while ((i = e - n) > 0) {
|
|
11965
|
-
const {done: e, value: a} = await this.next();
|
|
12038
|
+
const {done: e, value: a} = await this.next.next();
|
|
11966
12039
|
if (e || !a?.byteLength) {
|
|
11967
12040
|
break;
|
|
11968
12041
|
} else if (a.byteLength > i) {
|
|
@@ -12000,7 +12073,7 @@ class ReadableStreamBlockReader {
|
|
|
12000
12073
|
}
|
|
12001
12074
|
}
|
|
12002
12075
|
this.blockLocked = !1;
|
|
12003
|
-
const {done: i, value: a} = await this.next();
|
|
12076
|
+
const {done: i, value: a} = await this.next.next();
|
|
12004
12077
|
if (i) {
|
|
12005
12078
|
return null;
|
|
12006
12079
|
} else if (a.byteLength > e) {
|
|
@@ -12030,7 +12103,7 @@ class ReadableStreamBlockReader {
|
|
|
12030
12103
|
}
|
|
12031
12104
|
}
|
|
12032
12105
|
while (t > 0) {
|
|
12033
|
-
const {done: e, value: n} = await this.next();
|
|
12106
|
+
const {done: e, value: n} = await this.next.next();
|
|
12034
12107
|
if (e) {
|
|
12035
12108
|
return t;
|
|
12036
12109
|
} else if (n.byteLength > t) {
|
|
@@ -12260,29 +12333,34 @@ async function expectTrailer(e, t) {
|
|
|
12260
12333
|
async function decodeHeaders(e) {
|
|
12261
12334
|
let t = 0;
|
|
12262
12335
|
const n = Object.create(null);
|
|
12263
|
-
while (t
|
|
12336
|
+
while (t <= 32e3) {
|
|
12264
12337
|
let i = "";
|
|
12338
|
+
let a = 0;
|
|
12265
12339
|
for await (const n of readUntilBoundary(e, s, l)) {
|
|
12266
12340
|
if (null == n) {
|
|
12267
12341
|
throw new Error("Invalid Multipart Headers: Unexpected EOF");
|
|
12268
12342
|
} else if (!t && !i && 45 === n[0] && 45 === n[1]) {
|
|
12269
12343
|
return null;
|
|
12270
12344
|
} else {
|
|
12271
|
-
|
|
12272
|
-
if (
|
|
12345
|
+
a += n.byteLength;
|
|
12346
|
+
if (a > 16e3) {
|
|
12273
12347
|
throw new Error("Invalid Multipart Headers: A header exceeded its maximum length of 16kB");
|
|
12274
12348
|
}
|
|
12349
|
+
i += d.decode(n, {
|
|
12350
|
+
stream: !0
|
|
12351
|
+
});
|
|
12275
12352
|
}
|
|
12276
12353
|
}
|
|
12354
|
+
i += d.decode();
|
|
12277
12355
|
if (i) {
|
|
12278
12356
|
const e = i.indexOf(":");
|
|
12279
12357
|
if (e > -1) {
|
|
12280
|
-
const
|
|
12281
|
-
const
|
|
12282
|
-
if (
|
|
12283
|
-
n[
|
|
12358
|
+
const r = i.slice(0, e).trim().toLowerCase();
|
|
12359
|
+
const o = i.slice(e + 1).trim();
|
|
12360
|
+
if (o) {
|
|
12361
|
+
n[r] = o;
|
|
12284
12362
|
}
|
|
12285
|
-
t +=
|
|
12363
|
+
t += a + s.byteLength;
|
|
12286
12364
|
} else {
|
|
12287
12365
|
throw new Error("Invalid Multipart Headers: Invalid header value missing `:`");
|
|
12288
12366
|
}
|
|
@@ -12290,113 +12368,119 @@ async function decodeHeaders(e) {
|
|
|
12290
12368
|
break;
|
|
12291
12369
|
}
|
|
12292
12370
|
}
|
|
12293
|
-
if (t >
|
|
12371
|
+
if (t > 32e3) {
|
|
12294
12372
|
throw new Error("Invalid Multipart Headers: Headers exceeded their maximum length of 32kB");
|
|
12295
12373
|
}
|
|
12296
12374
|
return n;
|
|
12297
12375
|
}
|
|
12298
12376
|
|
|
12299
12377
|
async function* parseMultipart(e, t) {
|
|
12300
|
-
const n =
|
|
12301
|
-
|
|
12302
|
-
|
|
12303
|
-
|
|
12304
|
-
|
|
12305
|
-
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12309
|
-
|
|
12310
|
-
|
|
12311
|
-
|
|
12312
|
-
|
|
12313
|
-
|
|
12314
|
-
|
|
12315
|
-
|
|
12316
|
-
|
|
12317
|
-
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
}(i, n);
|
|
12324
|
-
let a;
|
|
12325
|
-
while (a = await decodeHeaders(i)) {
|
|
12326
|
-
const e = a["content-type"];
|
|
12327
|
-
const t = parseContentDisposition(a["content-disposition"]);
|
|
12328
|
-
const r = t?.filename || t?.name;
|
|
12329
|
-
const o = parseContentLength(a["content-length"]);
|
|
12330
|
-
if (!r) {
|
|
12331
|
-
throw new Error("Invalid Multipart Part: Missing Content-Disposition name or filename parameter");
|
|
12332
|
-
}
|
|
12333
|
-
let s = !1;
|
|
12334
|
-
let l = 0;
|
|
12335
|
-
let c;
|
|
12336
|
-
if (null !== o) {
|
|
12337
|
-
l = o;
|
|
12338
|
-
c = createReadableStream({
|
|
12339
|
-
expectedLength: o,
|
|
12340
|
-
async cancel() {
|
|
12341
|
-
if (l > 0) {
|
|
12342
|
-
l = await i.skip(l);
|
|
12343
|
-
if (l > 0) {
|
|
12344
|
-
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12345
|
-
}
|
|
12346
|
-
}
|
|
12347
|
-
if (!s) {
|
|
12348
|
-
await expectTrailer(i, n);
|
|
12349
|
-
s = !0;
|
|
12350
|
-
}
|
|
12351
|
-
},
|
|
12352
|
-
async pull(e) {
|
|
12353
|
-
if (l) {
|
|
12354
|
-
const t = await i.pull(l);
|
|
12355
|
-
if (!t) {
|
|
12356
|
-
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12357
|
-
}
|
|
12358
|
-
l -= t.byteLength;
|
|
12359
|
-
e.enqueue(i.blockLocked ? t.slice() : t);
|
|
12360
|
-
}
|
|
12361
|
-
if (!l) {
|
|
12362
|
-
await expectTrailer(i, n);
|
|
12363
|
-
s = !0;
|
|
12364
|
-
e.close();
|
|
12378
|
+
const n = new ReadableStreamBlockReader(e, 4096);
|
|
12379
|
+
try {
|
|
12380
|
+
yield* async function* readMultipart(e, t) {
|
|
12381
|
+
const n = function convertToBoundaryBytes(e) {
|
|
12382
|
+
const t = e.match(c);
|
|
12383
|
+
const n = `--${t?.[1] || "-"}`;
|
|
12384
|
+
const i = `\r\n${n}`;
|
|
12385
|
+
const a = utf8Encode(n);
|
|
12386
|
+
const r = utf8Encode(i);
|
|
12387
|
+
return {
|
|
12388
|
+
raw: a,
|
|
12389
|
+
rawSkipTable: bytesToSkipTable(a),
|
|
12390
|
+
trailer: r,
|
|
12391
|
+
trailerSkipTable: bytesToSkipTable(r)
|
|
12392
|
+
};
|
|
12393
|
+
}(t.contentType);
|
|
12394
|
+
await async function expectPreamble(e, t) {
|
|
12395
|
+
let n = 0;
|
|
12396
|
+
for await (const i of readUntilBoundary(e, t.raw, t.rawSkipTable)) {
|
|
12397
|
+
if (null == i) {
|
|
12398
|
+
throw new Error("Invalid Multipart Preamble: Unexpected EOF");
|
|
12399
|
+
} else if ((n += i?.byteLength) > 16e3) {
|
|
12400
|
+
throw new Error("Invalid Multipart Preamble: Boundary not found within the first 16kB");
|
|
12365
12401
|
}
|
|
12366
12402
|
}
|
|
12367
|
-
});
|
|
12368
|
-
|
|
12369
|
-
|
|
12370
|
-
|
|
12371
|
-
|
|
12372
|
-
|
|
12373
|
-
|
|
12374
|
-
|
|
12403
|
+
}(e, n);
|
|
12404
|
+
let i;
|
|
12405
|
+
while (i = await decodeHeaders(e)) {
|
|
12406
|
+
const t = i["content-type"];
|
|
12407
|
+
const a = parseContentDisposition(i["content-disposition"]);
|
|
12408
|
+
const r = a?.filename || a?.name;
|
|
12409
|
+
const o = parseContentLength(i["content-length"]);
|
|
12410
|
+
if (!r) {
|
|
12411
|
+
throw new Error("Invalid Multipart Part: Missing Content-Disposition name or filename parameter");
|
|
12412
|
+
}
|
|
12413
|
+
let s = !1;
|
|
12414
|
+
let l = 0;
|
|
12415
|
+
let c;
|
|
12416
|
+
if (null !== o) {
|
|
12417
|
+
l = o;
|
|
12418
|
+
c = createReadableStream({
|
|
12419
|
+
expectedLength: o,
|
|
12420
|
+
async cancel() {
|
|
12421
|
+
if (l > 0) {
|
|
12422
|
+
l = await e.skip(l);
|
|
12423
|
+
if (l > 0) {
|
|
12424
|
+
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12425
|
+
}
|
|
12426
|
+
}
|
|
12427
|
+
if (!s) {
|
|
12428
|
+
await expectTrailer(e, n);
|
|
12429
|
+
s = !0;
|
|
12430
|
+
}
|
|
12431
|
+
},
|
|
12432
|
+
async pull(t) {
|
|
12433
|
+
if (l) {
|
|
12434
|
+
const n = await e.pull(l);
|
|
12435
|
+
if (!n) {
|
|
12436
|
+
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12437
|
+
}
|
|
12438
|
+
l -= n.byteLength;
|
|
12439
|
+
t.enqueue(e.blockLocked ? n.slice() : n);
|
|
12440
|
+
}
|
|
12441
|
+
if (!l) {
|
|
12442
|
+
await expectTrailer(e, n);
|
|
12443
|
+
s = !0;
|
|
12444
|
+
t.close();
|
|
12445
|
+
}
|
|
12375
12446
|
}
|
|
12376
|
-
}
|
|
12377
|
-
|
|
12378
|
-
|
|
12379
|
-
|
|
12380
|
-
|
|
12381
|
-
|
|
12382
|
-
|
|
12383
|
-
|
|
12384
|
-
|
|
12385
|
-
|
|
12386
|
-
|
|
12387
|
-
|
|
12388
|
-
|
|
12447
|
+
});
|
|
12448
|
+
} else {
|
|
12449
|
+
const t = readUntilBoundary(e, n.trailer, n.trailerSkipTable);
|
|
12450
|
+
c = createReadableStream({
|
|
12451
|
+
async cancel() {
|
|
12452
|
+
for await (const e of t) {
|
|
12453
|
+
if (!e) {
|
|
12454
|
+
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12455
|
+
}
|
|
12456
|
+
}
|
|
12457
|
+
s = !0;
|
|
12458
|
+
},
|
|
12459
|
+
async pull(e) {
|
|
12460
|
+
const n = await t.next();
|
|
12461
|
+
if (n.done) {
|
|
12462
|
+
e.close();
|
|
12463
|
+
s = !0;
|
|
12464
|
+
} else if (!n.value) {
|
|
12465
|
+
throw new Error("Invalid Multipart Part: Unexpected EOF");
|
|
12466
|
+
} else {
|
|
12467
|
+
e.enqueue(n.value.slice());
|
|
12468
|
+
}
|
|
12469
|
+
}
|
|
12470
|
+
});
|
|
12389
12471
|
}
|
|
12390
|
-
|
|
12391
|
-
|
|
12392
|
-
|
|
12393
|
-
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12397
|
-
|
|
12398
|
-
|
|
12399
|
-
}
|
|
12472
|
+
yield new MultipartPart(c, r, {
|
|
12473
|
+
type: t ?? void 0,
|
|
12474
|
+
size: o ?? void 0,
|
|
12475
|
+
headers: i
|
|
12476
|
+
});
|
|
12477
|
+
if (l > 0 || !s) {
|
|
12478
|
+
await c.cancel();
|
|
12479
|
+
}
|
|
12480
|
+
}
|
|
12481
|
+
}(n, t);
|
|
12482
|
+
} finally {
|
|
12483
|
+
await n.close();
|
|
12400
12484
|
}
|
|
12401
12485
|
}
|
|
12402
12486
|
|
|
@@ -12410,9 +12494,10 @@ const isBlob = e => "object" == typeof e && null != e && (e instanceof Multipart
|
|
|
12410
12494
|
|
|
12411
12495
|
const makeFormHeader = (e, t) => {
|
|
12412
12496
|
let n = f + i + u;
|
|
12413
|
-
|
|
12497
|
+
const a = encodeName(e.name);
|
|
12498
|
+
n += `Content-Disposition: form-data; name="${a}"`;
|
|
12414
12499
|
if (null != e.filename) {
|
|
12415
|
-
n += `; filename="${encodeName(e.filename)}"`;
|
|
12500
|
+
n += `; filename="${e.filename === e.name ? a : encodeName(e.filename)}"`;
|
|
12416
12501
|
}
|
|
12417
12502
|
if (t) {
|
|
12418
12503
|
if (t.type) {
|
|
@@ -12434,39 +12519,36 @@ const makeFormHeader = (e, t) => {
|
|
|
12434
12519
|
return n;
|
|
12435
12520
|
};
|
|
12436
12521
|
|
|
12437
|
-
const
|
|
12522
|
+
const y = (/* unused pure expression or super */ null && (`multipart/form-data; boundary=${i}`));
|
|
12438
12523
|
|
|
12439
12524
|
async function* streamMultipart(e) {
|
|
12440
|
-
const n
|
|
12441
|
-
|
|
12442
|
-
while (!(i = await n()).done && i.value) {
|
|
12443
|
-
const e = i.value[0];
|
|
12444
|
-
const n = i.value[1];
|
|
12445
|
-
if (isBlob(n)) {
|
|
12525
|
+
for await (const [n, i] of streamLikeToIterator(e)) {
|
|
12526
|
+
if (isBlob(i)) {
|
|
12446
12527
|
yield t.encode(makeFormHeader({
|
|
12447
|
-
name:
|
|
12448
|
-
filename: "name" in
|
|
12449
|
-
},
|
|
12450
|
-
|
|
12528
|
+
name: n,
|
|
12529
|
+
filename: "name" in i ? i.name : n
|
|
12530
|
+
}, i));
|
|
12531
|
+
const e = i.stream();
|
|
12532
|
+
yield* streamToSizedAsyncIterable(e, i.size || null, "Invalid Multipart: Part");
|
|
12451
12533
|
} else {
|
|
12452
12534
|
yield t.encode(makeFormHeader({
|
|
12453
|
-
name:
|
|
12535
|
+
name: n
|
|
12454
12536
|
}, void 0));
|
|
12455
|
-
yield "string" == typeof
|
|
12537
|
+
yield "string" == typeof i ? t.encode(i) : i;
|
|
12456
12538
|
}
|
|
12457
12539
|
yield t.encode(u);
|
|
12458
12540
|
}
|
|
12459
12541
|
yield t.encode(h);
|
|
12460
12542
|
}
|
|
12461
12543
|
|
|
12462
|
-
const
|
|
12544
|
+
const m = 512;
|
|
12463
12545
|
|
|
12464
12546
|
function blockPad(e) {
|
|
12465
12547
|
const t = 511 & e;
|
|
12466
|
-
return t &&
|
|
12548
|
+
return t && m - t;
|
|
12467
12549
|
}
|
|
12468
12550
|
|
|
12469
|
-
let
|
|
12551
|
+
let p = function(e) {
|
|
12470
12552
|
e[e.FILE = 48] = "FILE";
|
|
12471
12553
|
e[e.LINK = 49] = "LINK";
|
|
12472
12554
|
e[e.SYMLINK = 50] = "SYMLINK";
|
|
@@ -12482,12 +12564,13 @@ function initTarHeader(e) {
|
|
|
12482
12564
|
gid: e?.gid || 0,
|
|
12483
12565
|
size: e?.size || 0,
|
|
12484
12566
|
mtime: e?.mtime || 0,
|
|
12485
|
-
typeflag: e?.typeflag ||
|
|
12567
|
+
typeflag: e?.typeflag || p.FILE,
|
|
12486
12568
|
linkname: e?.linkname || null,
|
|
12487
12569
|
uname: e?.uname || null,
|
|
12488
12570
|
gname: e?.gname || null,
|
|
12489
12571
|
devmajor: e?.devmajor || 0,
|
|
12490
|
-
devminor: e?.devminor || 0
|
|
12572
|
+
devminor: e?.devminor || 0,
|
|
12573
|
+
_paxSize: e?._paxSize
|
|
12491
12574
|
};
|
|
12492
12575
|
}
|
|
12493
12576
|
|
|
@@ -12503,7 +12586,7 @@ const getTarName = e => {
|
|
|
12503
12586
|
}
|
|
12504
12587
|
};
|
|
12505
12588
|
|
|
12506
|
-
const getTarSize = e => e._paxSize
|
|
12589
|
+
const getTarSize = e => e._paxSize ?? e.size;
|
|
12507
12590
|
|
|
12508
12591
|
class TarChunk extends StreamFile {
|
|
12509
12592
|
constructor(e, t) {
|
|
@@ -12541,7 +12624,7 @@ class TarFile extends StreamFile {
|
|
|
12541
12624
|
this.uid = t.uid;
|
|
12542
12625
|
this.gid = t.gid;
|
|
12543
12626
|
this.mtime = t.mtime;
|
|
12544
|
-
this.typeflag =
|
|
12627
|
+
this.typeflag = p.FILE;
|
|
12545
12628
|
this.linkname = null;
|
|
12546
12629
|
this.uname = t.uname;
|
|
12547
12630
|
this.gname = t.gname;
|
|
@@ -12552,59 +12635,60 @@ class TarFile extends StreamFile {
|
|
|
12552
12635
|
|
|
12553
12636
|
async function decodePax(e, t, i) {
|
|
12554
12637
|
let a = i.size;
|
|
12555
|
-
|
|
12638
|
+
const r = [];
|
|
12556
12639
|
while (a > 0) {
|
|
12557
|
-
|
|
12640
|
+
const t = await e.read();
|
|
12558
12641
|
if (!t || t.byteLength !== e.blockSize) {
|
|
12559
12642
|
throw new Error("Invalid Tar: Unexpected EOF while parsing PAX data");
|
|
12560
12643
|
}
|
|
12561
|
-
a
|
|
12562
|
-
|
|
12563
|
-
|
|
12564
|
-
|
|
12565
|
-
|
|
12566
|
-
|
|
12567
|
-
|
|
12644
|
+
const n = Math.min(a, t.byteLength);
|
|
12645
|
+
r.push(t.slice(0, n));
|
|
12646
|
+
a -= n;
|
|
12647
|
+
}
|
|
12648
|
+
const o = new Uint8Array(i.size);
|
|
12649
|
+
for (let e = 0, t = 0; e < r.length; e++) {
|
|
12650
|
+
o.set(r[e], t);
|
|
12651
|
+
t += r[e].byteLength;
|
|
12568
12652
|
}
|
|
12569
|
-
for (let e = 0,
|
|
12570
|
-
while (
|
|
12571
|
-
|
|
12653
|
+
for (let e = 0, a = 0; e < o.byteLength; a = e) {
|
|
12654
|
+
while (a < o.byteLength && 32 !== o[a]) {
|
|
12655
|
+
a++;
|
|
12572
12656
|
}
|
|
12573
|
-
const
|
|
12574
|
-
if (!
|
|
12657
|
+
const r = parseInt(n.decode(o.subarray(e, a)), 10);
|
|
12658
|
+
if (!r || r != r) {
|
|
12575
12659
|
break;
|
|
12576
12660
|
}
|
|
12577
|
-
if (10 !==
|
|
12661
|
+
if (10 !== o[e + r - 1]) {
|
|
12578
12662
|
break;
|
|
12579
12663
|
}
|
|
12580
|
-
const
|
|
12581
|
-
const
|
|
12582
|
-
if (-1 ===
|
|
12664
|
+
const s = n.decode(o.subarray(a + 1, e + r - 1));
|
|
12665
|
+
const l = s.indexOf("=");
|
|
12666
|
+
if (-1 === l) {
|
|
12583
12667
|
break;
|
|
12584
12668
|
}
|
|
12585
|
-
const
|
|
12586
|
-
const
|
|
12587
|
-
e +=
|
|
12588
|
-
switch (
|
|
12669
|
+
const c = s.slice(0, l);
|
|
12670
|
+
const d = s.slice(l + 1);
|
|
12671
|
+
e += r;
|
|
12672
|
+
switch (c) {
|
|
12589
12673
|
case "path":
|
|
12590
12674
|
if (t) {
|
|
12591
|
-
t._paxName =
|
|
12675
|
+
t._paxName = d;
|
|
12592
12676
|
}
|
|
12593
|
-
i._paxName =
|
|
12677
|
+
i._paxName = d;
|
|
12594
12678
|
break;
|
|
12595
12679
|
|
|
12596
12680
|
case "linkpath":
|
|
12597
12681
|
if (t) {
|
|
12598
|
-
t._paxLinkName =
|
|
12682
|
+
t._paxLinkName = d;
|
|
12599
12683
|
}
|
|
12600
|
-
i._paxLinkName =
|
|
12684
|
+
i._paxLinkName = d;
|
|
12601
12685
|
break;
|
|
12602
12686
|
|
|
12603
12687
|
case "size":
|
|
12604
12688
|
if (t) {
|
|
12605
|
-
t._paxSize = +
|
|
12689
|
+
t._paxSize = +d;
|
|
12606
12690
|
}
|
|
12607
|
-
i._paxSize = +
|
|
12691
|
+
i._paxSize = +d;
|
|
12608
12692
|
break;
|
|
12609
12693
|
|
|
12610
12694
|
case "gid":
|
|
@@ -12612,17 +12696,17 @@ async function decodePax(e, t, i) {
|
|
|
12612
12696
|
case "mode":
|
|
12613
12697
|
case "mtime":
|
|
12614
12698
|
if (t) {
|
|
12615
|
-
t[
|
|
12699
|
+
t[c] = +d;
|
|
12616
12700
|
}
|
|
12617
|
-
i[
|
|
12701
|
+
i[c] = +d;
|
|
12618
12702
|
break;
|
|
12619
12703
|
|
|
12620
12704
|
case "uname":
|
|
12621
12705
|
case "gname":
|
|
12622
12706
|
if (t) {
|
|
12623
|
-
t[
|
|
12707
|
+
t[c] = d;
|
|
12624
12708
|
}
|
|
12625
|
-
i[
|
|
12709
|
+
i[c] = d;
|
|
12626
12710
|
}
|
|
12627
12711
|
}
|
|
12628
12712
|
}
|
|
@@ -12730,7 +12814,7 @@ function decodeBase(e, t) {
|
|
|
12730
12814
|
e._prefix = decodeString(t, 345, 500);
|
|
12731
12815
|
}
|
|
12732
12816
|
if (0 === e.typeflag && e.name.endsWith("/")) {
|
|
12733
|
-
e.typeflag =
|
|
12817
|
+
e.typeflag = p.DIRECTORY;
|
|
12734
12818
|
}
|
|
12735
12819
|
}
|
|
12736
12820
|
|
|
@@ -12765,10 +12849,10 @@ async function decodeHeader(e, t) {
|
|
|
12765
12849
|
|
|
12766
12850
|
case 0:
|
|
12767
12851
|
case 55:
|
|
12768
|
-
case
|
|
12769
|
-
case
|
|
12770
|
-
case
|
|
12771
|
-
case
|
|
12852
|
+
case p.FILE:
|
|
12853
|
+
case p.LINK:
|
|
12854
|
+
case p.SYMLINK:
|
|
12855
|
+
case p.DIRECTORY:
|
|
12772
12856
|
decodeBase(i, n);
|
|
12773
12857
|
return i;
|
|
12774
12858
|
|
|
@@ -12789,79 +12873,91 @@ async function decodeHeader(e, t) {
|
|
|
12789
12873
|
}
|
|
12790
12874
|
|
|
12791
12875
|
async function* untar(e) {
|
|
12792
|
-
const t =
|
|
12793
|
-
|
|
12794
|
-
|
|
12795
|
-
|
|
12796
|
-
|
|
12797
|
-
|
|
12798
|
-
|
|
12799
|
-
|
|
12800
|
-
|
|
12801
|
-
async cancel() {
|
|
12802
|
-
if (!t) {
|
|
12803
|
-
t = !0;
|
|
12804
|
-
a += e;
|
|
12805
|
-
}
|
|
12806
|
-
if (a > 0) {
|
|
12807
|
-
if (await n.skip(a) > 0) {
|
|
12808
|
-
throw new Error("Invalid Tar: Unexpected EOF");
|
|
12809
|
-
}
|
|
12810
|
-
a = 0;
|
|
12811
|
-
}
|
|
12812
|
-
},
|
|
12813
|
-
async pull(i) {
|
|
12814
|
-
if (a) {
|
|
12815
|
-
const e = await n.pull(a);
|
|
12816
|
-
if (!e) {
|
|
12817
|
-
throw new Error("Invalid Tar: Unexpected EOF");
|
|
12818
|
-
}
|
|
12819
|
-
a -= e.byteLength;
|
|
12820
|
-
i.enqueue(n.blockLocked ? e.slice() : e);
|
|
12876
|
+
const t = new ReadableStreamBlockReader(e, m);
|
|
12877
|
+
try {
|
|
12878
|
+
yield* async function* readTar(e) {
|
|
12879
|
+
const t = initTarHeader(null);
|
|
12880
|
+
let n;
|
|
12881
|
+
while (null != (n = await decodeHeader(e, t))) {
|
|
12882
|
+
const t = n._paxSize ?? n.size;
|
|
12883
|
+
if (!Number.isSafeInteger(t) || t < 0) {
|
|
12884
|
+
throw new Error(`Invalid Tar: Invalid entry size ${t}`);
|
|
12821
12885
|
}
|
|
12822
|
-
|
|
12823
|
-
|
|
12824
|
-
|
|
12825
|
-
|
|
12826
|
-
|
|
12886
|
+
const i = blockPad(t);
|
|
12887
|
+
let a = 0 === i;
|
|
12888
|
+
let r = t;
|
|
12889
|
+
const o = createReadableStream({
|
|
12890
|
+
expectedLength: t,
|
|
12891
|
+
async cancel() {
|
|
12892
|
+
if (!a) {
|
|
12893
|
+
r += i;
|
|
12894
|
+
}
|
|
12895
|
+
if (r > 0) {
|
|
12896
|
+
if (await e.skip(r) > 0) {
|
|
12897
|
+
throw new Error("Invalid Tar: Unexpected EOF");
|
|
12898
|
+
}
|
|
12899
|
+
r = 0;
|
|
12900
|
+
}
|
|
12901
|
+
a = !0;
|
|
12902
|
+
},
|
|
12903
|
+
async pull(t) {
|
|
12904
|
+
if (r) {
|
|
12905
|
+
const n = await e.pull(r);
|
|
12906
|
+
if (!n) {
|
|
12907
|
+
throw new Error("Invalid Tar: Unexpected EOF");
|
|
12908
|
+
}
|
|
12909
|
+
r -= n.byteLength;
|
|
12910
|
+
t.enqueue(e.blockLocked ? n.slice() : n);
|
|
12911
|
+
}
|
|
12912
|
+
if (!r) {
|
|
12913
|
+
if (!a) {
|
|
12914
|
+
if (await e.skip(i) > 0) {
|
|
12915
|
+
throw new Error("Invalid Tar: Unexpected EOF");
|
|
12916
|
+
}
|
|
12917
|
+
a = !0;
|
|
12918
|
+
}
|
|
12919
|
+
t.close();
|
|
12827
12920
|
}
|
|
12828
12921
|
}
|
|
12829
|
-
|
|
12830
|
-
|
|
12831
|
-
|
|
12832
|
-
|
|
12833
|
-
|
|
12834
|
-
|
|
12835
|
-
|
|
12836
|
-
|
|
12837
|
-
case y.FILE:
|
|
12838
|
-
o = new TarFile(r, i);
|
|
12839
|
-
break;
|
|
12922
|
+
});
|
|
12923
|
+
let s;
|
|
12924
|
+
switch (n.typeflag) {
|
|
12925
|
+
case 0:
|
|
12926
|
+
case 55:
|
|
12927
|
+
case p.FILE:
|
|
12928
|
+
s = new TarFile(o, n);
|
|
12929
|
+
break;
|
|
12840
12930
|
|
|
12841
|
-
|
|
12842
|
-
|
|
12843
|
-
|
|
12844
|
-
|
|
12845
|
-
|
|
12931
|
+
case p.LINK:
|
|
12932
|
+
case p.SYMLINK:
|
|
12933
|
+
case p.DIRECTORY:
|
|
12934
|
+
s = new TarChunk(o, n);
|
|
12935
|
+
break;
|
|
12846
12936
|
|
|
12847
|
-
|
|
12848
|
-
|
|
12849
|
-
|
|
12850
|
-
|
|
12851
|
-
|
|
12852
|
-
|
|
12853
|
-
|
|
12854
|
-
|
|
12937
|
+
default:
|
|
12938
|
+
await o.cancel();
|
|
12939
|
+
continue;
|
|
12940
|
+
}
|
|
12941
|
+
yield s;
|
|
12942
|
+
if (r > 0 || !a) {
|
|
12943
|
+
await o.cancel();
|
|
12944
|
+
}
|
|
12945
|
+
}
|
|
12946
|
+
}(t);
|
|
12947
|
+
} finally {
|
|
12948
|
+
await t.close();
|
|
12855
12949
|
}
|
|
12856
12950
|
}
|
|
12857
12951
|
|
|
12858
12952
|
const b = 100;
|
|
12859
12953
|
|
|
12860
|
-
const w = new Uint8Array(
|
|
12954
|
+
const w = new Uint8Array(m);
|
|
12955
|
+
|
|
12956
|
+
const g = /[^\x00-\x7f]/;
|
|
12861
12957
|
|
|
12862
12958
|
function encodeString(e, n, i, a) {
|
|
12863
12959
|
if (a) {
|
|
12864
|
-
t.encodeInto(
|
|
12960
|
+
t.encodeInto(a, e.subarray(n, i));
|
|
12865
12961
|
}
|
|
12866
12962
|
}
|
|
12867
12963
|
|
|
@@ -12899,28 +12995,9 @@ function encodeOctal(e, t, n, i) {
|
|
|
12899
12995
|
}
|
|
12900
12996
|
}
|
|
12901
12997
|
|
|
12902
|
-
function indexOfPrefixEnd(e) {
|
|
12903
|
-
if (e.length <= 255) {
|
|
12904
|
-
let t = e.length - 1;
|
|
12905
|
-
while ((t = e.lastIndexOf("/", t - 1)) > -1) {
|
|
12906
|
-
if (t < 155 && e.length - t - 1 < b) {
|
|
12907
|
-
return t;
|
|
12908
|
-
}
|
|
12909
|
-
}
|
|
12910
|
-
}
|
|
12911
|
-
return -1;
|
|
12912
|
-
}
|
|
12913
|
-
|
|
12914
12998
|
function encodeHeader(e) {
|
|
12915
|
-
const t = new Uint8Array(
|
|
12999
|
+
const t = new Uint8Array(m);
|
|
12916
13000
|
!function encodeBase(e, t) {
|
|
12917
|
-
let n = t.name;
|
|
12918
|
-
if (!t._paxName && !t._longName && n.length > b) {
|
|
12919
|
-
const e = indexOfPrefixEnd(n);
|
|
12920
|
-
if (e > -1) {
|
|
12921
|
-
n = n.slice(e + 1);
|
|
12922
|
-
}
|
|
12923
|
-
}
|
|
12924
13001
|
if (!t.typeflag) {
|
|
12925
13002
|
t.typeflag = function modeToType(e) {
|
|
12926
13003
|
switch (61440 & e) {
|
|
@@ -12931,26 +13008,26 @@ function encodeHeader(e) {
|
|
|
12931
13008
|
return 51;
|
|
12932
13009
|
|
|
12933
13010
|
case 16384:
|
|
12934
|
-
return
|
|
13011
|
+
return p.DIRECTORY;
|
|
12935
13012
|
|
|
12936
13013
|
case 4096:
|
|
12937
13014
|
return 54;
|
|
12938
13015
|
|
|
12939
13016
|
case 40960:
|
|
12940
|
-
return
|
|
13017
|
+
return p.SYMLINK;
|
|
12941
13018
|
|
|
12942
13019
|
default:
|
|
12943
|
-
return
|
|
13020
|
+
return p.FILE;
|
|
12944
13021
|
}
|
|
12945
13022
|
}(t.mode);
|
|
12946
13023
|
}
|
|
12947
13024
|
if (!t.mode) {
|
|
12948
|
-
t.mode = t.typeflag ===
|
|
13025
|
+
t.mode = t.typeflag === p.DIRECTORY ? 493 : 420;
|
|
12949
13026
|
}
|
|
12950
13027
|
if (!t.mtime) {
|
|
12951
13028
|
t.mtime = Math.floor(Date.now() / 1e3);
|
|
12952
13029
|
}
|
|
12953
|
-
encodeString(e, 0, 100,
|
|
13030
|
+
encodeString(e, 0, 100, t.name);
|
|
12954
13031
|
encodeOctal(e, 100, 108, 4095 & t.mode);
|
|
12955
13032
|
encodeOctal(e, 108, 116, t.uid);
|
|
12956
13033
|
encodeOctal(e, 116, 124, t.gid);
|
|
@@ -12979,15 +13056,15 @@ function encodeHeader(e) {
|
|
|
12979
13056
|
}
|
|
12980
13057
|
|
|
12981
13058
|
function encodePax(e) {
|
|
12982
|
-
function encodePaxEntry(e,
|
|
12983
|
-
const
|
|
12984
|
-
let
|
|
12985
|
-
const
|
|
12986
|
-
|
|
12987
|
-
if (1 + Math.floor(Math.log10(
|
|
12988
|
-
|
|
13059
|
+
function encodePaxEntry(e, n) {
|
|
13060
|
+
const i = ` ${e}=${n}\n`;
|
|
13061
|
+
let a = t.encode(i).byteLength;
|
|
13062
|
+
const r = `${a}`;
|
|
13063
|
+
a += r.length;
|
|
13064
|
+
if (1 + Math.floor(Math.log10(a)) > r.length) {
|
|
13065
|
+
a += 1;
|
|
12989
13066
|
}
|
|
12990
|
-
return `${
|
|
13067
|
+
return `${a}${i}`;
|
|
12991
13068
|
}
|
|
12992
13069
|
let n = "";
|
|
12993
13070
|
if (e._paxName) {
|
|
@@ -12999,64 +13076,84 @@ function encodePax(e) {
|
|
|
12999
13076
|
return n ? t.encode(n) : null;
|
|
13000
13077
|
}
|
|
13001
13078
|
|
|
13002
|
-
function
|
|
13003
|
-
|
|
13004
|
-
|
|
13079
|
+
function truncateHeaderString(e) {
|
|
13080
|
+
let t = 99;
|
|
13081
|
+
while (128 == (192 & e[t])) {
|
|
13082
|
+
t--;
|
|
13083
|
+
}
|
|
13084
|
+
return n.decode(e.subarray(0, t));
|
|
13005
13085
|
}
|
|
13006
13086
|
|
|
13007
|
-
|
|
13008
|
-
|
|
13009
|
-
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
t
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
const e = indexOfPrefixEnd(t.name);
|
|
13026
|
-
if (e > -1) {
|
|
13027
|
-
t._prefix = t.name.slice(0, e);
|
|
13028
|
-
t.name = t.name.slice(e + 1);
|
|
13087
|
+
function prepareHeaderStrings(e) {
|
|
13088
|
+
if (e.name.length > 33 && (e.name.length > b || g.test(e.name))) {
|
|
13089
|
+
const i = t.encode(e.name);
|
|
13090
|
+
if (i.byteLength > b) {
|
|
13091
|
+
const t = function indexOfPrefixEnd(e) {
|
|
13092
|
+
if (e.byteLength <= 255) {
|
|
13093
|
+
let t = e.byteLength;
|
|
13094
|
+
while ((t = e.lastIndexOf(47, t - 1)) > 0) {
|
|
13095
|
+
if (t < 155 && e.byteLength - t - 1 < b) {
|
|
13096
|
+
return t;
|
|
13097
|
+
}
|
|
13098
|
+
}
|
|
13099
|
+
}
|
|
13100
|
+
return -1;
|
|
13101
|
+
}(i);
|
|
13102
|
+
if (t > -1) {
|
|
13103
|
+
e._prefix = n.decode(i.subarray(0, t));
|
|
13104
|
+
e.name = n.decode(i.subarray(t + 1));
|
|
13029
13105
|
} else {
|
|
13030
|
-
|
|
13031
|
-
|
|
13106
|
+
e._paxName = e.name;
|
|
13107
|
+
e.name = truncateHeaderString(i);
|
|
13032
13108
|
}
|
|
13033
13109
|
}
|
|
13034
|
-
|
|
13035
|
-
|
|
13036
|
-
|
|
13110
|
+
}
|
|
13111
|
+
if (e.linkname && e.linkname.length > 33 && (e.linkname.length > b || g.test(e.linkname))) {
|
|
13112
|
+
const n = t.encode(e.linkname);
|
|
13113
|
+
if (n.byteLength > b) {
|
|
13114
|
+
e._paxLinkName = e.linkname;
|
|
13115
|
+
e.linkname = truncateHeaderString(n);
|
|
13037
13116
|
}
|
|
13038
|
-
|
|
13039
|
-
|
|
13117
|
+
}
|
|
13118
|
+
}
|
|
13119
|
+
|
|
13120
|
+
async function* tar(e) {
|
|
13121
|
+
for await (const t of streamLikeToIterator(e)) {
|
|
13122
|
+
const e = initTarHeader(t);
|
|
13123
|
+
if (!Number.isSafeInteger(e.size) || e.size < 0) {
|
|
13124
|
+
throw new Error(`Invalid Tar: Cannot safely encode part with size ${e.size}`);
|
|
13125
|
+
}
|
|
13126
|
+
if (t.lastModified && !e.mtime) {
|
|
13127
|
+
e.mtime = Math.floor(t.lastModified / 1e3);
|
|
13128
|
+
}
|
|
13129
|
+
if (e.typeflag === p.DIRECTORY && !e.name.endsWith("/")) {
|
|
13130
|
+
e.name += "/";
|
|
13131
|
+
} else if (e.typeflag === p.SYMLINK) {
|
|
13132
|
+
e.size = 0;
|
|
13133
|
+
}
|
|
13134
|
+
prepareHeaderStrings(e);
|
|
13135
|
+
const n = encodePax(e);
|
|
13136
|
+
if (n) {
|
|
13040
13137
|
const e = initTarHeader(null);
|
|
13041
13138
|
e.typeflag = 120;
|
|
13042
|
-
e.size =
|
|
13139
|
+
e.size = n.byteLength;
|
|
13043
13140
|
yield encodeHeader(e);
|
|
13044
|
-
yield
|
|
13045
|
-
const t = blockPad(
|
|
13141
|
+
yield n;
|
|
13142
|
+
const t = blockPad(n.byteLength);
|
|
13046
13143
|
if (t) {
|
|
13047
13144
|
yield w.subarray(0, t);
|
|
13048
13145
|
}
|
|
13049
13146
|
}
|
|
13050
|
-
yield encodeHeader(
|
|
13051
|
-
const
|
|
13052
|
-
if (
|
|
13053
|
-
yield*
|
|
13054
|
-
} else if (!
|
|
13055
|
-
await
|
|
13147
|
+
yield encodeHeader(e);
|
|
13148
|
+
const i = t.stream();
|
|
13149
|
+
if (e.size) {
|
|
13150
|
+
yield* streamToSizedAsyncIterable(i, e.size, "Invalid Tar: Entry");
|
|
13151
|
+
} else if (!i.locked) {
|
|
13152
|
+
await i.cancel();
|
|
13056
13153
|
}
|
|
13057
|
-
const
|
|
13058
|
-
if (
|
|
13059
|
-
yield w.subarray(0,
|
|
13154
|
+
const a = blockPad(e.size);
|
|
13155
|
+
if (a) {
|
|
13156
|
+
yield w.subarray(0, a);
|
|
13060
13157
|
}
|
|
13061
13158
|
}
|
|
13062
13159
|
yield new Uint8Array(1024);
|