@prisma/migrate 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.4 → 6.6.0-integration-mcp.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/dist/bin.js +14 -14
- package/dist/{chunk-EJUXYFV3.js → chunk-BYRRPHGM.js} +206 -3
- package/dist/{chunk-CKRN45WP.js → chunk-FJ22R36R.js} +6 -6
- package/dist/{chunk-B4SUSDC2.js → chunk-GBMQW4HZ.js} +6 -6
- package/dist/{chunk-UWQXMKQO.js → chunk-KF6K4EE5.js} +297 -2135
- package/dist/{chunk-O723A5JE.js → chunk-LVDALRAV.js} +6 -6
- package/dist/{chunk-L53C3AX3.js → chunk-PPOA6UUS.js} +296 -2134
- package/dist/{chunk-TGV6QGEF.js → chunk-QVMYNWAN.js} +191 -37
- package/dist/{chunk-5LKIRKDL.js → chunk-XPJHNEKB.js} +12 -12
- package/dist/{chunk-QJT4H5N6.js → chunk-ZJ4IDCRR.js} +4 -4
- package/dist/commands/DbPull.js +3 -3
- package/dist/commands/DbSeed.js +3 -3
- package/dist/commands/MigrateDev.js +3 -3
- package/dist/commands/MigrateDiff.js +3 -3
- package/dist/commands/MigrateReset.js +3 -3
- package/dist/index.js +14 -17
- package/dist/internals/src/cli/directoryConfig.d.ts +1 -1
- package/dist/internals/src/cli/getSchema.d.ts +3 -28
- package/dist/internals/src/cli/hashes.d.ts +1 -2
- package/dist/internals/src/cli/schemaContext.d.ts +4 -3
- package/dist/internals/src/index.d.ts +1 -1
- package/dist/migrate/src/index.d.ts +0 -1
- package/dist/{multipart-parser-ASKQAOL4-WZ47HU6G.js → multipart-parser-AOASR4DL-AXIJXW2B.js} +702 -228
- package/dist/{multipart-parser-QCI3Y5IB.js → multipart-parser-GQA7KJYT.js} +687 -213
- package/dist/open-KDTCMDK7.js +530 -0
- package/dist/utils/seed.js +3 -3
- package/dist/utils/setupCockroach.js +2 -2
- package/dist/utils/setupMSSQL.js +21636 -30315
- package/dist/utils/setupMongo.js +3327 -834
- package/dist/utils/setupPostgres.js +2 -2
- package/package.json +8 -8
- package/dist/chunk-GKDFIHM2.js +0 -45
- package/dist/migrate/src/utils/getSchemaPathAndPrint.d.ts +0 -10
- package/dist/utils/getSchemaPathAndPrint.js +0 -27
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var multipart_parser_GQA7KJYT_exports = {};
|
|
20
|
+
__export(multipart_parser_GQA7KJYT_exports, {
|
|
21
21
|
toFormData: () => toFormData
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(multipart_parser_GQA7KJYT_exports);
|
|
24
24
|
var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
|
|
25
25
|
var import_node_fs = require("node:fs");
|
|
26
26
|
var require_node_domexception = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
@@ -38,40 +38,36 @@ var require_node_domexception = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
41
|
-
"../../node_modules/.pnpm/web-streams-polyfill@3.
|
|
41
|
+
"../../node_modules/.pnpm/web-streams-polyfill@3.3.3/node_modules/web-streams-polyfill/dist/ponyfill.es2018.js"(exports, module2) {
|
|
42
42
|
"use strict";
|
|
43
43
|
(function(global2, factory) {
|
|
44
44
|
typeof exports === "object" && typeof module2 !== "undefined" ? factory(exports) : typeof define === "function" && define.amd ? define(["exports"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2.WebStreamsPolyfill = {}));
|
|
45
45
|
})(exports, function(exports2) {
|
|
46
46
|
"use strict";
|
|
47
|
-
const SymbolPolyfill = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? Symbol : (description) => `Symbol(${description})`;
|
|
48
47
|
function noop2() {
|
|
49
48
|
return void 0;
|
|
50
49
|
}
|
|
51
|
-
function getGlobals() {
|
|
52
|
-
if (typeof self !== "undefined") {
|
|
53
|
-
return self;
|
|
54
|
-
} else if (typeof window !== "undefined") {
|
|
55
|
-
return window;
|
|
56
|
-
} else if (typeof global !== "undefined") {
|
|
57
|
-
return global;
|
|
58
|
-
}
|
|
59
|
-
return void 0;
|
|
60
|
-
}
|
|
61
|
-
const globals = getGlobals();
|
|
62
50
|
function typeIsObject(x2) {
|
|
63
51
|
return typeof x2 === "object" && x2 !== null || typeof x2 === "function";
|
|
64
52
|
}
|
|
65
53
|
const rethrowAssertionErrorRejection = noop2;
|
|
54
|
+
function setFunctionName(fn, name) {
|
|
55
|
+
try {
|
|
56
|
+
Object.defineProperty(fn, "name", {
|
|
57
|
+
value: name,
|
|
58
|
+
configurable: true
|
|
59
|
+
});
|
|
60
|
+
} catch (_a2) {
|
|
61
|
+
}
|
|
62
|
+
}
|
|
66
63
|
const originalPromise = Promise;
|
|
67
64
|
const originalPromiseThen = Promise.prototype.then;
|
|
68
|
-
const originalPromiseResolve = Promise.resolve.bind(originalPromise);
|
|
69
65
|
const originalPromiseReject = Promise.reject.bind(originalPromise);
|
|
70
66
|
function newPromise(executor) {
|
|
71
67
|
return new originalPromise(executor);
|
|
72
68
|
}
|
|
73
69
|
function promiseResolvedWith(value) {
|
|
74
|
-
return
|
|
70
|
+
return newPromise((resolve) => resolve(value));
|
|
75
71
|
}
|
|
76
72
|
function promiseRejectedWith(reason) {
|
|
77
73
|
return originalPromiseReject(reason);
|
|
@@ -94,14 +90,15 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
94
90
|
function setPromiseIsHandledToTrue(promise) {
|
|
95
91
|
PerformPromiseThen(promise, void 0, rethrowAssertionErrorRejection);
|
|
96
92
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
93
|
+
let _queueMicrotask = (callback) => {
|
|
94
|
+
if (typeof queueMicrotask === "function") {
|
|
95
|
+
_queueMicrotask = queueMicrotask;
|
|
96
|
+
} else {
|
|
97
|
+
const resolvedPromise = promiseResolvedWith(void 0);
|
|
98
|
+
_queueMicrotask = (cb) => PerformPromiseThen(resolvedPromise, cb);
|
|
101
99
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
})();
|
|
100
|
+
return _queueMicrotask(callback);
|
|
101
|
+
};
|
|
105
102
|
function reflectCall(F2, V, args) {
|
|
106
103
|
if (typeof F2 !== "function") {
|
|
107
104
|
throw new TypeError("Argument is not a function");
|
|
@@ -205,6 +202,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
205
202
|
return front._elements[cursor];
|
|
206
203
|
}
|
|
207
204
|
}
|
|
205
|
+
const AbortSteps = Symbol("[[AbortSteps]]");
|
|
206
|
+
const ErrorSteps = Symbol("[[ErrorSteps]]");
|
|
207
|
+
const CancelSteps = Symbol("[[CancelSteps]]");
|
|
208
|
+
const PullSteps = Symbol("[[PullSteps]]");
|
|
209
|
+
const ReleaseSteps = Symbol("[[ReleaseSteps]]");
|
|
208
210
|
function ReadableStreamReaderGenericInitialize(reader, stream) {
|
|
209
211
|
reader._ownerReadableStream = stream;
|
|
210
212
|
stream._reader = reader;
|
|
@@ -221,12 +223,14 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
221
223
|
return ReadableStreamCancel(stream, reason);
|
|
222
224
|
}
|
|
223
225
|
function ReadableStreamReaderGenericRelease(reader) {
|
|
224
|
-
|
|
226
|
+
const stream = reader._ownerReadableStream;
|
|
227
|
+
if (stream._state === "readable") {
|
|
225
228
|
defaultReaderClosedPromiseReject(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));
|
|
226
229
|
} else {
|
|
227
230
|
defaultReaderClosedPromiseResetToRejected(reader, new TypeError(`Reader was released and can no longer be used to monitor the stream's closedness`));
|
|
228
231
|
}
|
|
229
|
-
|
|
232
|
+
stream._readableStreamController[ReleaseSteps]();
|
|
233
|
+
stream._reader = void 0;
|
|
230
234
|
reader._ownerReadableStream = void 0;
|
|
231
235
|
}
|
|
232
236
|
function readerLockException(name) {
|
|
@@ -266,10 +270,6 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
266
270
|
reader._closedPromise_resolve = void 0;
|
|
267
271
|
reader._closedPromise_reject = void 0;
|
|
268
272
|
}
|
|
269
|
-
const AbortSteps = SymbolPolyfill("[[AbortSteps]]");
|
|
270
|
-
const ErrorSteps = SymbolPolyfill("[[ErrorSteps]]");
|
|
271
|
-
const CancelSteps = SymbolPolyfill("[[CancelSteps]]");
|
|
272
|
-
const PullSteps = SymbolPolyfill("[[PullSteps]]");
|
|
273
273
|
const NumberIsFinite = Number.isFinite || function(x2) {
|
|
274
274
|
return typeof x2 === "number" && isFinite(x2);
|
|
275
275
|
};
|
|
@@ -440,10 +440,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
440
440
|
if (this._ownerReadableStream === void 0) {
|
|
441
441
|
return;
|
|
442
442
|
}
|
|
443
|
-
|
|
444
|
-
throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
|
|
445
|
-
}
|
|
446
|
-
ReadableStreamReaderGenericRelease(this);
|
|
443
|
+
ReadableStreamDefaultReaderRelease(this);
|
|
447
444
|
}
|
|
448
445
|
}
|
|
449
446
|
Object.defineProperties(ReadableStreamDefaultReader.prototype, {
|
|
@@ -452,8 +449,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
452
449
|
releaseLock: { enumerable: true },
|
|
453
450
|
closed: { enumerable: true }
|
|
454
451
|
});
|
|
455
|
-
|
|
456
|
-
|
|
452
|
+
setFunctionName(ReadableStreamDefaultReader.prototype.cancel, "cancel");
|
|
453
|
+
setFunctionName(ReadableStreamDefaultReader.prototype.read, "read");
|
|
454
|
+
setFunctionName(ReadableStreamDefaultReader.prototype.releaseLock, "releaseLock");
|
|
455
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
456
|
+
Object.defineProperty(ReadableStreamDefaultReader.prototype, Symbol.toStringTag, {
|
|
457
457
|
value: "ReadableStreamDefaultReader",
|
|
458
458
|
configurable: true
|
|
459
459
|
});
|
|
@@ -478,6 +478,18 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
478
478
|
stream._readableStreamController[PullSteps](readRequest);
|
|
479
479
|
}
|
|
480
480
|
}
|
|
481
|
+
function ReadableStreamDefaultReaderRelease(reader) {
|
|
482
|
+
ReadableStreamReaderGenericRelease(reader);
|
|
483
|
+
const e = new TypeError("Reader was released");
|
|
484
|
+
ReadableStreamDefaultReaderErrorReadRequests(reader, e);
|
|
485
|
+
}
|
|
486
|
+
function ReadableStreamDefaultReaderErrorReadRequests(reader, e) {
|
|
487
|
+
const readRequests = reader._readRequests;
|
|
488
|
+
reader._readRequests = new SimpleQueue();
|
|
489
|
+
readRequests.forEach((readRequest) => {
|
|
490
|
+
readRequest._errorSteps(e);
|
|
491
|
+
});
|
|
492
|
+
}
|
|
481
493
|
function defaultReaderBrandCheckException(name) {
|
|
482
494
|
return new TypeError(`ReadableStreamDefaultReader.prototype.${name} can only be used on a ReadableStreamDefaultReader`);
|
|
483
495
|
}
|
|
@@ -504,9 +516,6 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
504
516
|
return Promise.resolve({ value: void 0, done: true });
|
|
505
517
|
}
|
|
506
518
|
const reader = this._reader;
|
|
507
|
-
if (reader._ownerReadableStream === void 0) {
|
|
508
|
-
return promiseRejectedWith(readerLockException("iterate"));
|
|
509
|
-
}
|
|
510
519
|
let resolvePromise;
|
|
511
520
|
let rejectPromise;
|
|
512
521
|
const promise = newPromise((resolve, reject) => {
|
|
@@ -516,7 +525,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
516
525
|
const readRequest = {
|
|
517
526
|
_chunkSteps: (chunk) => {
|
|
518
527
|
this._ongoingPromise = void 0;
|
|
519
|
-
|
|
528
|
+
_queueMicrotask(() => resolvePromise({ value: chunk, done: false }));
|
|
520
529
|
},
|
|
521
530
|
_closeSteps: () => {
|
|
522
531
|
this._ongoingPromise = void 0;
|
|
@@ -540,9 +549,6 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
540
549
|
}
|
|
541
550
|
this._isFinished = true;
|
|
542
551
|
const reader = this._reader;
|
|
543
|
-
if (reader._ownerReadableStream === void 0) {
|
|
544
|
-
return promiseRejectedWith(readerLockException("finish iterating"));
|
|
545
|
-
}
|
|
546
552
|
if (!this._preventCancel) {
|
|
547
553
|
const result = ReadableStreamReaderGenericCancel(reader, value);
|
|
548
554
|
ReadableStreamReaderGenericRelease(reader);
|
|
@@ -566,9 +572,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
566
572
|
return this._asyncIteratorImpl.return(value);
|
|
567
573
|
}
|
|
568
574
|
};
|
|
569
|
-
|
|
570
|
-
Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);
|
|
571
|
-
}
|
|
575
|
+
Object.setPrototypeOf(ReadableStreamAsyncIteratorPrototype, AsyncIteratorPrototype);
|
|
572
576
|
function AcquireReadableStreamAsyncIterator(stream, preventCancel) {
|
|
573
577
|
const reader = AcquireReadableStreamDefaultReader(stream);
|
|
574
578
|
const impl = new ReadableStreamAsyncIteratorImpl(reader, preventCancel);
|
|
@@ -585,7 +589,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
585
589
|
}
|
|
586
590
|
try {
|
|
587
591
|
return x2._asyncIteratorImpl instanceof ReadableStreamAsyncIteratorImpl;
|
|
588
|
-
} catch (
|
|
592
|
+
} catch (_a2) {
|
|
589
593
|
return false;
|
|
590
594
|
}
|
|
591
595
|
}
|
|
@@ -595,18 +599,31 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
595
599
|
const NumberIsNaN = Number.isNaN || function(x2) {
|
|
596
600
|
return x2 !== x2;
|
|
597
601
|
};
|
|
602
|
+
var _a, _b, _c;
|
|
598
603
|
function CreateArrayFromList(elements) {
|
|
599
604
|
return elements.slice();
|
|
600
605
|
}
|
|
601
606
|
function CopyDataBlockBytes(dest, destOffset, src, srcOffset, n) {
|
|
602
607
|
new Uint8Array(dest).set(new Uint8Array(src, srcOffset, n), destOffset);
|
|
603
608
|
}
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
609
|
+
let TransferArrayBuffer = (O) => {
|
|
610
|
+
if (typeof O.transfer === "function") {
|
|
611
|
+
TransferArrayBuffer = (buffer) => buffer.transfer();
|
|
612
|
+
} else if (typeof structuredClone === "function") {
|
|
613
|
+
TransferArrayBuffer = (buffer) => structuredClone(buffer, { transfer: [buffer] });
|
|
614
|
+
} else {
|
|
615
|
+
TransferArrayBuffer = (buffer) => buffer;
|
|
616
|
+
}
|
|
617
|
+
return TransferArrayBuffer(O);
|
|
618
|
+
};
|
|
619
|
+
let IsDetachedBuffer = (O) => {
|
|
620
|
+
if (typeof O.detached === "boolean") {
|
|
621
|
+
IsDetachedBuffer = (buffer) => buffer.detached;
|
|
622
|
+
} else {
|
|
623
|
+
IsDetachedBuffer = (buffer) => buffer.byteLength === 0;
|
|
624
|
+
}
|
|
625
|
+
return IsDetachedBuffer(O);
|
|
626
|
+
};
|
|
610
627
|
function ArrayBufferSlice(buffer, begin, end) {
|
|
611
628
|
if (buffer.slice) {
|
|
612
629
|
return buffer.slice(begin, end);
|
|
@@ -616,6 +633,63 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
616
633
|
CopyDataBlockBytes(slice, 0, buffer, begin, length);
|
|
617
634
|
return slice;
|
|
618
635
|
}
|
|
636
|
+
function GetMethod(receiver, prop) {
|
|
637
|
+
const func = receiver[prop];
|
|
638
|
+
if (func === void 0 || func === null) {
|
|
639
|
+
return void 0;
|
|
640
|
+
}
|
|
641
|
+
if (typeof func !== "function") {
|
|
642
|
+
throw new TypeError(`${String(prop)} is not a function`);
|
|
643
|
+
}
|
|
644
|
+
return func;
|
|
645
|
+
}
|
|
646
|
+
function CreateAsyncFromSyncIterator(syncIteratorRecord) {
|
|
647
|
+
const syncIterable = {
|
|
648
|
+
[Symbol.iterator]: () => syncIteratorRecord.iterator
|
|
649
|
+
};
|
|
650
|
+
const asyncIterator = async function* () {
|
|
651
|
+
return yield* syncIterable;
|
|
652
|
+
}();
|
|
653
|
+
const nextMethod = asyncIterator.next;
|
|
654
|
+
return { iterator: asyncIterator, nextMethod, done: false };
|
|
655
|
+
}
|
|
656
|
+
const SymbolAsyncIterator = (_c = (_a = Symbol.asyncIterator) !== null && _a !== void 0 ? _a : (_b = Symbol.for) === null || _b === void 0 ? void 0 : _b.call(Symbol, "Symbol.asyncIterator")) !== null && _c !== void 0 ? _c : "@@asyncIterator";
|
|
657
|
+
function GetIterator(obj, hint = "sync", method) {
|
|
658
|
+
if (method === void 0) {
|
|
659
|
+
if (hint === "async") {
|
|
660
|
+
method = GetMethod(obj, SymbolAsyncIterator);
|
|
661
|
+
if (method === void 0) {
|
|
662
|
+
const syncMethod = GetMethod(obj, Symbol.iterator);
|
|
663
|
+
const syncIteratorRecord = GetIterator(obj, "sync", syncMethod);
|
|
664
|
+
return CreateAsyncFromSyncIterator(syncIteratorRecord);
|
|
665
|
+
}
|
|
666
|
+
} else {
|
|
667
|
+
method = GetMethod(obj, Symbol.iterator);
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
if (method === void 0) {
|
|
671
|
+
throw new TypeError("The object is not iterable");
|
|
672
|
+
}
|
|
673
|
+
const iterator = reflectCall(method, obj, []);
|
|
674
|
+
if (!typeIsObject(iterator)) {
|
|
675
|
+
throw new TypeError("The iterator method must return an object");
|
|
676
|
+
}
|
|
677
|
+
const nextMethod = iterator.next;
|
|
678
|
+
return { iterator, nextMethod, done: false };
|
|
679
|
+
}
|
|
680
|
+
function IteratorNext(iteratorRecord) {
|
|
681
|
+
const result = reflectCall(iteratorRecord.nextMethod, iteratorRecord.iterator, []);
|
|
682
|
+
if (!typeIsObject(result)) {
|
|
683
|
+
throw new TypeError("The iterator.next() method must return an object");
|
|
684
|
+
}
|
|
685
|
+
return result;
|
|
686
|
+
}
|
|
687
|
+
function IteratorComplete(iterResult) {
|
|
688
|
+
return Boolean(iterResult.done);
|
|
689
|
+
}
|
|
690
|
+
function IteratorValue(iterResult) {
|
|
691
|
+
return iterResult.value;
|
|
692
|
+
}
|
|
619
693
|
function IsNonNegativeNumber(v) {
|
|
620
694
|
if (typeof v !== "number") {
|
|
621
695
|
return false;
|
|
@@ -655,6 +729,18 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
655
729
|
container._queue = new SimpleQueue();
|
|
656
730
|
container._queueTotalSize = 0;
|
|
657
731
|
}
|
|
732
|
+
function isDataViewConstructor(ctor) {
|
|
733
|
+
return ctor === DataView;
|
|
734
|
+
}
|
|
735
|
+
function isDataView(view) {
|
|
736
|
+
return isDataViewConstructor(view.constructor);
|
|
737
|
+
}
|
|
738
|
+
function arrayBufferViewElementSize(ctor) {
|
|
739
|
+
if (isDataViewConstructor(ctor)) {
|
|
740
|
+
return 1;
|
|
741
|
+
}
|
|
742
|
+
return ctor.BYTES_PER_ELEMENT;
|
|
743
|
+
}
|
|
658
744
|
class ReadableStreamBYOBRequest {
|
|
659
745
|
constructor() {
|
|
660
746
|
throw new TypeError("Illegal constructor");
|
|
@@ -677,7 +763,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
677
763
|
if (this._associatedReadableByteStreamController === void 0) {
|
|
678
764
|
throw new TypeError("This BYOB request has been invalidated");
|
|
679
765
|
}
|
|
680
|
-
if (IsDetachedBuffer(this._view.buffer))
|
|
766
|
+
if (IsDetachedBuffer(this._view.buffer)) {
|
|
767
|
+
throw new TypeError(`The BYOB request's buffer has been detached and so cannot be used as a response`);
|
|
768
|
+
}
|
|
681
769
|
ReadableByteStreamControllerRespond(this._associatedReadableByteStreamController, bytesWritten);
|
|
682
770
|
}
|
|
683
771
|
respondWithNewView(view) {
|
|
@@ -691,7 +779,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
691
779
|
if (this._associatedReadableByteStreamController === void 0) {
|
|
692
780
|
throw new TypeError("This BYOB request has been invalidated");
|
|
693
781
|
}
|
|
694
|
-
if (IsDetachedBuffer(view.buffer))
|
|
782
|
+
if (IsDetachedBuffer(view.buffer)) {
|
|
783
|
+
throw new TypeError("The given view's buffer has been detached and so cannot be used as a response");
|
|
784
|
+
}
|
|
695
785
|
ReadableByteStreamControllerRespondWithNewView(this._associatedReadableByteStreamController, view);
|
|
696
786
|
}
|
|
697
787
|
}
|
|
@@ -700,8 +790,10 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
700
790
|
respondWithNewView: { enumerable: true },
|
|
701
791
|
view: { enumerable: true }
|
|
702
792
|
});
|
|
703
|
-
|
|
704
|
-
|
|
793
|
+
setFunctionName(ReadableStreamBYOBRequest.prototype.respond, "respond");
|
|
794
|
+
setFunctionName(ReadableStreamBYOBRequest.prototype.respondWithNewView, "respondWithNewView");
|
|
795
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
796
|
+
Object.defineProperty(ReadableStreamBYOBRequest.prototype, Symbol.toStringTag, {
|
|
705
797
|
value: "ReadableStreamBYOBRequest",
|
|
706
798
|
configurable: true
|
|
707
799
|
});
|
|
@@ -790,11 +882,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
790
882
|
[PullSteps](readRequest) {
|
|
791
883
|
const stream = this._controlledReadableByteStream;
|
|
792
884
|
if (this._queueTotalSize > 0) {
|
|
793
|
-
|
|
794
|
-
this._queueTotalSize -= entry.byteLength;
|
|
795
|
-
ReadableByteStreamControllerHandleQueueDrain(this);
|
|
796
|
-
const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);
|
|
797
|
-
readRequest._chunkSteps(view);
|
|
885
|
+
ReadableByteStreamControllerFillReadRequestFromQueue(this, readRequest);
|
|
798
886
|
return;
|
|
799
887
|
}
|
|
800
888
|
const autoAllocateChunkSize = this._autoAllocateChunkSize;
|
|
@@ -812,6 +900,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
812
900
|
byteOffset: 0,
|
|
813
901
|
byteLength: autoAllocateChunkSize,
|
|
814
902
|
bytesFilled: 0,
|
|
903
|
+
minimumFill: 1,
|
|
815
904
|
elementSize: 1,
|
|
816
905
|
viewConstructor: Uint8Array,
|
|
817
906
|
readerType: "default"
|
|
@@ -821,6 +910,15 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
821
910
|
ReadableStreamAddReadRequest(stream, readRequest);
|
|
822
911
|
ReadableByteStreamControllerCallPullIfNeeded(this);
|
|
823
912
|
}
|
|
913
|
+
/** @internal */
|
|
914
|
+
[ReleaseSteps]() {
|
|
915
|
+
if (this._pendingPullIntos.length > 0) {
|
|
916
|
+
const firstPullInto = this._pendingPullIntos.peek();
|
|
917
|
+
firstPullInto.readerType = "none";
|
|
918
|
+
this._pendingPullIntos = new SimpleQueue();
|
|
919
|
+
this._pendingPullIntos.push(firstPullInto);
|
|
920
|
+
}
|
|
921
|
+
}
|
|
824
922
|
}
|
|
825
923
|
Object.defineProperties(ReadableByteStreamController.prototype, {
|
|
826
924
|
close: { enumerable: true },
|
|
@@ -829,8 +927,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
829
927
|
byobRequest: { enumerable: true },
|
|
830
928
|
desiredSize: { enumerable: true }
|
|
831
929
|
});
|
|
832
|
-
|
|
833
|
-
|
|
930
|
+
setFunctionName(ReadableByteStreamController.prototype.close, "close");
|
|
931
|
+
setFunctionName(ReadableByteStreamController.prototype.enqueue, "enqueue");
|
|
932
|
+
setFunctionName(ReadableByteStreamController.prototype.error, "error");
|
|
933
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
934
|
+
Object.defineProperty(ReadableByteStreamController.prototype, Symbol.toStringTag, {
|
|
834
935
|
value: "ReadableByteStreamController",
|
|
835
936
|
configurable: true
|
|
836
937
|
});
|
|
@@ -870,8 +971,10 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
870
971
|
controller._pullAgain = false;
|
|
871
972
|
ReadableByteStreamControllerCallPullIfNeeded(controller);
|
|
872
973
|
}
|
|
974
|
+
return null;
|
|
873
975
|
}, (e) => {
|
|
874
976
|
ReadableByteStreamControllerError(controller, e);
|
|
977
|
+
return null;
|
|
875
978
|
});
|
|
876
979
|
}
|
|
877
980
|
function ReadableByteStreamControllerClearPendingPullIntos(controller) {
|
|
@@ -899,15 +1002,30 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
899
1002
|
controller._queue.push({ buffer, byteOffset, byteLength });
|
|
900
1003
|
controller._queueTotalSize += byteLength;
|
|
901
1004
|
}
|
|
1005
|
+
function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, buffer, byteOffset, byteLength) {
|
|
1006
|
+
let clonedChunk;
|
|
1007
|
+
try {
|
|
1008
|
+
clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);
|
|
1009
|
+
} catch (cloneE) {
|
|
1010
|
+
ReadableByteStreamControllerError(controller, cloneE);
|
|
1011
|
+
throw cloneE;
|
|
1012
|
+
}
|
|
1013
|
+
ReadableByteStreamControllerEnqueueChunkToQueue(controller, clonedChunk, 0, byteLength);
|
|
1014
|
+
}
|
|
1015
|
+
function ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstDescriptor) {
|
|
1016
|
+
if (firstDescriptor.bytesFilled > 0) {
|
|
1017
|
+
ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, firstDescriptor.buffer, firstDescriptor.byteOffset, firstDescriptor.bytesFilled);
|
|
1018
|
+
}
|
|
1019
|
+
ReadableByteStreamControllerShiftPendingPullInto(controller);
|
|
1020
|
+
}
|
|
902
1021
|
function ReadableByteStreamControllerFillPullIntoDescriptorFromQueue(controller, pullIntoDescriptor) {
|
|
903
|
-
const elementSize = pullIntoDescriptor.elementSize;
|
|
904
|
-
const currentAlignedBytes = pullIntoDescriptor.bytesFilled - pullIntoDescriptor.bytesFilled % elementSize;
|
|
905
1022
|
const maxBytesToCopy = Math.min(controller._queueTotalSize, pullIntoDescriptor.byteLength - pullIntoDescriptor.bytesFilled);
|
|
906
1023
|
const maxBytesFilled = pullIntoDescriptor.bytesFilled + maxBytesToCopy;
|
|
907
|
-
const maxAlignedBytes = maxBytesFilled - maxBytesFilled % elementSize;
|
|
908
1024
|
let totalBytesToCopyRemaining = maxBytesToCopy;
|
|
909
1025
|
let ready = false;
|
|
910
|
-
|
|
1026
|
+
const remainderBytes = maxBytesFilled % pullIntoDescriptor.elementSize;
|
|
1027
|
+
const maxAlignedBytes = maxBytesFilled - remainderBytes;
|
|
1028
|
+
if (maxAlignedBytes >= pullIntoDescriptor.minimumFill) {
|
|
911
1029
|
totalBytesToCopyRemaining = maxAlignedBytes - pullIntoDescriptor.bytesFilled;
|
|
912
1030
|
ready = true;
|
|
913
1031
|
}
|
|
@@ -960,20 +1078,36 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
960
1078
|
}
|
|
961
1079
|
}
|
|
962
1080
|
}
|
|
963
|
-
function
|
|
964
|
-
const
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
1081
|
+
function ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller) {
|
|
1082
|
+
const reader = controller._controlledReadableByteStream._reader;
|
|
1083
|
+
while (reader._readRequests.length > 0) {
|
|
1084
|
+
if (controller._queueTotalSize === 0) {
|
|
1085
|
+
return;
|
|
1086
|
+
}
|
|
1087
|
+
const readRequest = reader._readRequests.shift();
|
|
1088
|
+
ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest);
|
|
968
1089
|
}
|
|
1090
|
+
}
|
|
1091
|
+
function ReadableByteStreamControllerPullInto(controller, view, min, readIntoRequest) {
|
|
1092
|
+
const stream = controller._controlledReadableByteStream;
|
|
969
1093
|
const ctor = view.constructor;
|
|
970
|
-
const
|
|
1094
|
+
const elementSize = arrayBufferViewElementSize(ctor);
|
|
1095
|
+
const { byteOffset, byteLength } = view;
|
|
1096
|
+
const minimumFill = min * elementSize;
|
|
1097
|
+
let buffer;
|
|
1098
|
+
try {
|
|
1099
|
+
buffer = TransferArrayBuffer(view.buffer);
|
|
1100
|
+
} catch (e) {
|
|
1101
|
+
readIntoRequest._errorSteps(e);
|
|
1102
|
+
return;
|
|
1103
|
+
}
|
|
971
1104
|
const pullIntoDescriptor = {
|
|
972
1105
|
buffer,
|
|
973
1106
|
bufferByteLength: buffer.byteLength,
|
|
974
|
-
byteOffset
|
|
975
|
-
byteLength
|
|
1107
|
+
byteOffset,
|
|
1108
|
+
byteLength,
|
|
976
1109
|
bytesFilled: 0,
|
|
1110
|
+
minimumFill,
|
|
977
1111
|
elementSize,
|
|
978
1112
|
viewConstructor: ctor,
|
|
979
1113
|
readerType: "byob"
|
|
@@ -1007,6 +1141,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1007
1141
|
ReadableByteStreamControllerCallPullIfNeeded(controller);
|
|
1008
1142
|
}
|
|
1009
1143
|
function ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor) {
|
|
1144
|
+
if (firstDescriptor.readerType === "none") {
|
|
1145
|
+
ReadableByteStreamControllerShiftPendingPullInto(controller);
|
|
1146
|
+
}
|
|
1010
1147
|
const stream = controller._controlledReadableByteStream;
|
|
1011
1148
|
if (ReadableStreamHasBYOBReader(stream)) {
|
|
1012
1149
|
while (ReadableStreamGetNumReadIntoRequests(stream) > 0) {
|
|
@@ -1017,15 +1154,19 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1017
1154
|
}
|
|
1018
1155
|
function ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, pullIntoDescriptor) {
|
|
1019
1156
|
ReadableByteStreamControllerFillHeadPullIntoDescriptor(controller, bytesWritten, pullIntoDescriptor);
|
|
1020
|
-
if (pullIntoDescriptor.
|
|
1157
|
+
if (pullIntoDescriptor.readerType === "none") {
|
|
1158
|
+
ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, pullIntoDescriptor);
|
|
1159
|
+
ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue(controller);
|
|
1160
|
+
return;
|
|
1161
|
+
}
|
|
1162
|
+
if (pullIntoDescriptor.bytesFilled < pullIntoDescriptor.minimumFill) {
|
|
1021
1163
|
return;
|
|
1022
1164
|
}
|
|
1023
1165
|
ReadableByteStreamControllerShiftPendingPullInto(controller);
|
|
1024
1166
|
const remainderSize = pullIntoDescriptor.bytesFilled % pullIntoDescriptor.elementSize;
|
|
1025
1167
|
if (remainderSize > 0) {
|
|
1026
1168
|
const end = pullIntoDescriptor.byteOffset + pullIntoDescriptor.bytesFilled;
|
|
1027
|
-
|
|
1028
|
-
ReadableByteStreamControllerEnqueueChunkToQueue(controller, remainder, 0, remainder.byteLength);
|
|
1169
|
+
ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller, pullIntoDescriptor.buffer, end - remainderSize, remainderSize);
|
|
1029
1170
|
}
|
|
1030
1171
|
pullIntoDescriptor.bytesFilled -= remainderSize;
|
|
1031
1172
|
ReadableByteStreamControllerCommitPullIntoDescriptor(controller._controlledReadableByteStream, pullIntoDescriptor);
|
|
@@ -1036,7 +1177,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1036
1177
|
ReadableByteStreamControllerInvalidateBYOBRequest(controller);
|
|
1037
1178
|
const state = controller._controlledReadableByteStream._state;
|
|
1038
1179
|
if (state === "closed") {
|
|
1039
|
-
ReadableByteStreamControllerRespondInClosedState(controller);
|
|
1180
|
+
ReadableByteStreamControllerRespondInClosedState(controller, firstDescriptor);
|
|
1040
1181
|
} else {
|
|
1041
1182
|
ReadableByteStreamControllerRespondInReadableState(controller, bytesWritten, firstDescriptor);
|
|
1042
1183
|
}
|
|
@@ -1084,7 +1225,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1084
1225
|
}
|
|
1085
1226
|
if (controller._pendingPullIntos.length > 0) {
|
|
1086
1227
|
const firstPendingPullInto = controller._pendingPullIntos.peek();
|
|
1087
|
-
if (firstPendingPullInto.bytesFilled
|
|
1228
|
+
if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) {
|
|
1088
1229
|
const e = new TypeError("Insufficient bytes to fill elements in the given buffer");
|
|
1089
1230
|
ReadableByteStreamControllerError(controller, e);
|
|
1090
1231
|
throw e;
|
|
@@ -1098,17 +1239,24 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1098
1239
|
if (controller._closeRequested || stream._state !== "readable") {
|
|
1099
1240
|
return;
|
|
1100
1241
|
}
|
|
1101
|
-
const buffer = chunk
|
|
1102
|
-
|
|
1103
|
-
|
|
1242
|
+
const { buffer, byteOffset, byteLength } = chunk;
|
|
1243
|
+
if (IsDetachedBuffer(buffer)) {
|
|
1244
|
+
throw new TypeError("chunk's buffer is detached and so cannot be enqueued");
|
|
1245
|
+
}
|
|
1104
1246
|
const transferredBuffer = TransferArrayBuffer(buffer);
|
|
1105
1247
|
if (controller._pendingPullIntos.length > 0) {
|
|
1106
1248
|
const firstPendingPullInto = controller._pendingPullIntos.peek();
|
|
1107
|
-
if (IsDetachedBuffer(firstPendingPullInto.buffer))
|
|
1249
|
+
if (IsDetachedBuffer(firstPendingPullInto.buffer)) {
|
|
1250
|
+
throw new TypeError("The BYOB request's buffer has been detached and so cannot be filled with an enqueued chunk");
|
|
1251
|
+
}
|
|
1252
|
+
ReadableByteStreamControllerInvalidateBYOBRequest(controller);
|
|
1108
1253
|
firstPendingPullInto.buffer = TransferArrayBuffer(firstPendingPullInto.buffer);
|
|
1254
|
+
if (firstPendingPullInto.readerType === "none") {
|
|
1255
|
+
ReadableByteStreamControllerEnqueueDetachedPullIntoToQueue(controller, firstPendingPullInto);
|
|
1256
|
+
}
|
|
1109
1257
|
}
|
|
1110
|
-
ReadableByteStreamControllerInvalidateBYOBRequest(controller);
|
|
1111
1258
|
if (ReadableStreamHasDefaultReader(stream)) {
|
|
1259
|
+
ReadableByteStreamControllerProcessReadRequestsUsingQueue(controller);
|
|
1112
1260
|
if (ReadableStreamGetNumReadRequests(stream) === 0) {
|
|
1113
1261
|
ReadableByteStreamControllerEnqueueChunkToQueue(controller, transferredBuffer, byteOffset, byteLength);
|
|
1114
1262
|
} else {
|
|
@@ -1136,6 +1284,13 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1136
1284
|
ReadableByteStreamControllerClearAlgorithms(controller);
|
|
1137
1285
|
ReadableStreamError(stream, e);
|
|
1138
1286
|
}
|
|
1287
|
+
function ReadableByteStreamControllerFillReadRequestFromQueue(controller, readRequest) {
|
|
1288
|
+
const entry = controller._queue.shift();
|
|
1289
|
+
controller._queueTotalSize -= entry.byteLength;
|
|
1290
|
+
ReadableByteStreamControllerHandleQueueDrain(controller);
|
|
1291
|
+
const view = new Uint8Array(entry.buffer, entry.byteOffset, entry.byteLength);
|
|
1292
|
+
readRequest._chunkSteps(view);
|
|
1293
|
+
}
|
|
1139
1294
|
function ReadableByteStreamControllerGetBYOBRequest(controller) {
|
|
1140
1295
|
if (controller._byobRequest === null && controller._pendingPullIntos.length > 0) {
|
|
1141
1296
|
const firstDescriptor = controller._pendingPullIntos.peek();
|
|
@@ -1218,23 +1373,31 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1218
1373
|
uponPromise(promiseResolvedWith(startResult), () => {
|
|
1219
1374
|
controller._started = true;
|
|
1220
1375
|
ReadableByteStreamControllerCallPullIfNeeded(controller);
|
|
1376
|
+
return null;
|
|
1221
1377
|
}, (r) => {
|
|
1222
1378
|
ReadableByteStreamControllerError(controller, r);
|
|
1379
|
+
return null;
|
|
1223
1380
|
});
|
|
1224
1381
|
}
|
|
1225
1382
|
function SetUpReadableByteStreamControllerFromUnderlyingSource(stream, underlyingByteSource, highWaterMark) {
|
|
1226
1383
|
const controller = Object.create(ReadableByteStreamController.prototype);
|
|
1227
|
-
let startAlgorithm
|
|
1228
|
-
let pullAlgorithm
|
|
1229
|
-
let cancelAlgorithm
|
|
1384
|
+
let startAlgorithm;
|
|
1385
|
+
let pullAlgorithm;
|
|
1386
|
+
let cancelAlgorithm;
|
|
1230
1387
|
if (underlyingByteSource.start !== void 0) {
|
|
1231
1388
|
startAlgorithm = () => underlyingByteSource.start(controller);
|
|
1389
|
+
} else {
|
|
1390
|
+
startAlgorithm = () => void 0;
|
|
1232
1391
|
}
|
|
1233
1392
|
if (underlyingByteSource.pull !== void 0) {
|
|
1234
1393
|
pullAlgorithm = () => underlyingByteSource.pull(controller);
|
|
1394
|
+
} else {
|
|
1395
|
+
pullAlgorithm = () => promiseResolvedWith(void 0);
|
|
1235
1396
|
}
|
|
1236
1397
|
if (underlyingByteSource.cancel !== void 0) {
|
|
1237
1398
|
cancelAlgorithm = (reason) => underlyingByteSource.cancel(reason);
|
|
1399
|
+
} else {
|
|
1400
|
+
cancelAlgorithm = () => promiseResolvedWith(void 0);
|
|
1238
1401
|
}
|
|
1239
1402
|
const autoAllocateChunkSize = underlyingByteSource.autoAllocateChunkSize;
|
|
1240
1403
|
if (autoAllocateChunkSize === 0) {
|
|
@@ -1252,6 +1415,28 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1252
1415
|
function byteStreamControllerBrandCheckException(name) {
|
|
1253
1416
|
return new TypeError(`ReadableByteStreamController.prototype.${name} can only be used on a ReadableByteStreamController`);
|
|
1254
1417
|
}
|
|
1418
|
+
function convertReaderOptions(options, context) {
|
|
1419
|
+
assertDictionary(options, context);
|
|
1420
|
+
const mode = options === null || options === void 0 ? void 0 : options.mode;
|
|
1421
|
+
return {
|
|
1422
|
+
mode: mode === void 0 ? void 0 : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)
|
|
1423
|
+
};
|
|
1424
|
+
}
|
|
1425
|
+
function convertReadableStreamReaderMode(mode, context) {
|
|
1426
|
+
mode = `${mode}`;
|
|
1427
|
+
if (mode !== "byob") {
|
|
1428
|
+
throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);
|
|
1429
|
+
}
|
|
1430
|
+
return mode;
|
|
1431
|
+
}
|
|
1432
|
+
function convertByobReadOptions(options, context) {
|
|
1433
|
+
var _a2;
|
|
1434
|
+
assertDictionary(options, context);
|
|
1435
|
+
const min = (_a2 = options === null || options === void 0 ? void 0 : options.min) !== null && _a2 !== void 0 ? _a2 : 1;
|
|
1436
|
+
return {
|
|
1437
|
+
min: convertUnsignedLongLongWithEnforceRange(min, `${context} has member 'min' that`)
|
|
1438
|
+
};
|
|
1439
|
+
}
|
|
1255
1440
|
function AcquireReadableStreamBYOBReader(stream) {
|
|
1256
1441
|
return new ReadableStreamBYOBReader(stream);
|
|
1257
1442
|
}
|
|
@@ -1315,12 +1500,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1315
1500
|
}
|
|
1316
1501
|
return ReadableStreamReaderGenericCancel(this, reason);
|
|
1317
1502
|
}
|
|
1318
|
-
|
|
1319
|
-
* Attempts to reads bytes into view, and returns a promise resolved with the result.
|
|
1320
|
-
*
|
|
1321
|
-
* If reading a chunk causes the queue to become empty, more data will be pulled from the underlying source.
|
|
1322
|
-
*/
|
|
1323
|
-
read(view) {
|
|
1503
|
+
read(view, rawOptions = {}) {
|
|
1324
1504
|
if (!IsReadableStreamBYOBReader(this)) {
|
|
1325
1505
|
return promiseRejectedWith(byobReaderBrandCheckException("read"));
|
|
1326
1506
|
}
|
|
@@ -1333,7 +1513,26 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1333
1513
|
if (view.buffer.byteLength === 0) {
|
|
1334
1514
|
return promiseRejectedWith(new TypeError(`view's buffer must have non-zero byteLength`));
|
|
1335
1515
|
}
|
|
1336
|
-
if (IsDetachedBuffer(view.buffer))
|
|
1516
|
+
if (IsDetachedBuffer(view.buffer)) {
|
|
1517
|
+
return promiseRejectedWith(new TypeError("view's buffer has been detached"));
|
|
1518
|
+
}
|
|
1519
|
+
let options;
|
|
1520
|
+
try {
|
|
1521
|
+
options = convertByobReadOptions(rawOptions, "options");
|
|
1522
|
+
} catch (e) {
|
|
1523
|
+
return promiseRejectedWith(e);
|
|
1524
|
+
}
|
|
1525
|
+
const min = options.min;
|
|
1526
|
+
if (min === 0) {
|
|
1527
|
+
return promiseRejectedWith(new TypeError("options.min must be greater than 0"));
|
|
1528
|
+
}
|
|
1529
|
+
if (!isDataView(view)) {
|
|
1530
|
+
if (min > view.length) {
|
|
1531
|
+
return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's length"));
|
|
1532
|
+
}
|
|
1533
|
+
} else if (min > view.byteLength) {
|
|
1534
|
+
return promiseRejectedWith(new RangeError("options.min must be less than or equal to view's byteLength"));
|
|
1535
|
+
}
|
|
1337
1536
|
if (this._ownerReadableStream === void 0) {
|
|
1338
1537
|
return promiseRejectedWith(readerLockException("read from"));
|
|
1339
1538
|
}
|
|
@@ -1348,7 +1547,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1348
1547
|
_closeSteps: (chunk) => resolvePromise({ value: chunk, done: true }),
|
|
1349
1548
|
_errorSteps: (e) => rejectPromise(e)
|
|
1350
1549
|
};
|
|
1351
|
-
ReadableStreamBYOBReaderRead(this, view, readIntoRequest);
|
|
1550
|
+
ReadableStreamBYOBReaderRead(this, view, min, readIntoRequest);
|
|
1352
1551
|
return promise;
|
|
1353
1552
|
}
|
|
1354
1553
|
/**
|
|
@@ -1367,10 +1566,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1367
1566
|
if (this._ownerReadableStream === void 0) {
|
|
1368
1567
|
return;
|
|
1369
1568
|
}
|
|
1370
|
-
|
|
1371
|
-
throw new TypeError("Tried to release a reader lock when that reader has pending read() calls un-settled");
|
|
1372
|
-
}
|
|
1373
|
-
ReadableStreamReaderGenericRelease(this);
|
|
1569
|
+
ReadableStreamBYOBReaderRelease(this);
|
|
1374
1570
|
}
|
|
1375
1571
|
}
|
|
1376
1572
|
Object.defineProperties(ReadableStreamBYOBReader.prototype, {
|
|
@@ -1379,8 +1575,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1379
1575
|
releaseLock: { enumerable: true },
|
|
1380
1576
|
closed: { enumerable: true }
|
|
1381
1577
|
});
|
|
1382
|
-
|
|
1383
|
-
|
|
1578
|
+
setFunctionName(ReadableStreamBYOBReader.prototype.cancel, "cancel");
|
|
1579
|
+
setFunctionName(ReadableStreamBYOBReader.prototype.read, "read");
|
|
1580
|
+
setFunctionName(ReadableStreamBYOBReader.prototype.releaseLock, "releaseLock");
|
|
1581
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
1582
|
+
Object.defineProperty(ReadableStreamBYOBReader.prototype, Symbol.toStringTag, {
|
|
1384
1583
|
value: "ReadableStreamBYOBReader",
|
|
1385
1584
|
configurable: true
|
|
1386
1585
|
});
|
|
@@ -1394,15 +1593,27 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1394
1593
|
}
|
|
1395
1594
|
return x2 instanceof ReadableStreamBYOBReader;
|
|
1396
1595
|
}
|
|
1397
|
-
function ReadableStreamBYOBReaderRead(reader, view, readIntoRequest) {
|
|
1596
|
+
function ReadableStreamBYOBReaderRead(reader, view, min, readIntoRequest) {
|
|
1398
1597
|
const stream = reader._ownerReadableStream;
|
|
1399
1598
|
stream._disturbed = true;
|
|
1400
1599
|
if (stream._state === "errored") {
|
|
1401
1600
|
readIntoRequest._errorSteps(stream._storedError);
|
|
1402
1601
|
} else {
|
|
1403
|
-
ReadableByteStreamControllerPullInto(stream._readableStreamController, view, readIntoRequest);
|
|
1602
|
+
ReadableByteStreamControllerPullInto(stream._readableStreamController, view, min, readIntoRequest);
|
|
1404
1603
|
}
|
|
1405
1604
|
}
|
|
1605
|
+
function ReadableStreamBYOBReaderRelease(reader) {
|
|
1606
|
+
ReadableStreamReaderGenericRelease(reader);
|
|
1607
|
+
const e = new TypeError("Reader was released");
|
|
1608
|
+
ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);
|
|
1609
|
+
}
|
|
1610
|
+
function ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e) {
|
|
1611
|
+
const readIntoRequests = reader._readIntoRequests;
|
|
1612
|
+
reader._readIntoRequests = new SimpleQueue();
|
|
1613
|
+
readIntoRequests.forEach((readIntoRequest) => {
|
|
1614
|
+
readIntoRequest._errorSteps(e);
|
|
1615
|
+
});
|
|
1616
|
+
}
|
|
1406
1617
|
function byobReaderBrandCheckException(name) {
|
|
1407
1618
|
return new TypeError(`ReadableStreamBYOBReader.prototype.${name} can only be used on a ReadableStreamBYOBReader`);
|
|
1408
1619
|
}
|
|
@@ -1478,7 +1689,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1478
1689
|
}
|
|
1479
1690
|
try {
|
|
1480
1691
|
return typeof value.aborted === "boolean";
|
|
1481
|
-
} catch (
|
|
1692
|
+
} catch (_a2) {
|
|
1482
1693
|
return false;
|
|
1483
1694
|
}
|
|
1484
1695
|
}
|
|
@@ -1575,8 +1786,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1575
1786
|
getWriter: { enumerable: true },
|
|
1576
1787
|
locked: { enumerable: true }
|
|
1577
1788
|
});
|
|
1578
|
-
|
|
1579
|
-
|
|
1789
|
+
setFunctionName(WritableStream.prototype.abort, "abort");
|
|
1790
|
+
setFunctionName(WritableStream.prototype.close, "close");
|
|
1791
|
+
setFunctionName(WritableStream.prototype.getWriter, "getWriter");
|
|
1792
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
1793
|
+
Object.defineProperty(WritableStream.prototype, Symbol.toStringTag, {
|
|
1580
1794
|
value: "WritableStream",
|
|
1581
1795
|
configurable: true
|
|
1582
1796
|
});
|
|
@@ -1619,12 +1833,12 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1619
1833
|
return true;
|
|
1620
1834
|
}
|
|
1621
1835
|
function WritableStreamAbort(stream, reason) {
|
|
1622
|
-
var
|
|
1836
|
+
var _a2;
|
|
1623
1837
|
if (stream._state === "closed" || stream._state === "errored") {
|
|
1624
1838
|
return promiseResolvedWith(void 0);
|
|
1625
1839
|
}
|
|
1626
1840
|
stream._writableStreamController._abortReason = reason;
|
|
1627
|
-
(
|
|
1841
|
+
(_a2 = stream._writableStreamController._abortController) === null || _a2 === void 0 ? void 0 : _a2.abort(reason);
|
|
1628
1842
|
const state = stream._state;
|
|
1629
1843
|
if (state === "closed" || state === "errored") {
|
|
1630
1844
|
return promiseResolvedWith(void 0);
|
|
@@ -1724,9 +1938,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1724
1938
|
uponPromise(promise, () => {
|
|
1725
1939
|
abortRequest._resolve();
|
|
1726
1940
|
WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
|
|
1941
|
+
return null;
|
|
1727
1942
|
}, (reason) => {
|
|
1728
1943
|
abortRequest._reject(reason);
|
|
1729
1944
|
WritableStreamRejectCloseAndClosedPromiseIfNeeded(stream);
|
|
1945
|
+
return null;
|
|
1730
1946
|
});
|
|
1731
1947
|
}
|
|
1732
1948
|
function WritableStreamFinishInFlightWrite(stream) {
|
|
@@ -1941,8 +2157,12 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
1941
2157
|
desiredSize: { enumerable: true },
|
|
1942
2158
|
ready: { enumerable: true }
|
|
1943
2159
|
});
|
|
1944
|
-
|
|
1945
|
-
|
|
2160
|
+
setFunctionName(WritableStreamDefaultWriter.prototype.abort, "abort");
|
|
2161
|
+
setFunctionName(WritableStreamDefaultWriter.prototype.close, "close");
|
|
2162
|
+
setFunctionName(WritableStreamDefaultWriter.prototype.releaseLock, "releaseLock");
|
|
2163
|
+
setFunctionName(WritableStreamDefaultWriter.prototype.write, "write");
|
|
2164
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
2165
|
+
Object.defineProperty(WritableStreamDefaultWriter.prototype, Symbol.toStringTag, {
|
|
1946
2166
|
value: "WritableStreamDefaultWriter",
|
|
1947
2167
|
configurable: true
|
|
1948
2168
|
});
|
|
@@ -2092,8 +2312,8 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2092
2312
|
signal: { enumerable: true },
|
|
2093
2313
|
error: { enumerable: true }
|
|
2094
2314
|
});
|
|
2095
|
-
if (typeof
|
|
2096
|
-
Object.defineProperty(WritableStreamDefaultController.prototype,
|
|
2315
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
2316
|
+
Object.defineProperty(WritableStreamDefaultController.prototype, Symbol.toStringTag, {
|
|
2097
2317
|
value: "WritableStreamDefaultController",
|
|
2098
2318
|
configurable: true
|
|
2099
2319
|
});
|
|
@@ -2128,28 +2348,38 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2128
2348
|
uponPromise(startPromise, () => {
|
|
2129
2349
|
controller._started = true;
|
|
2130
2350
|
WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
|
|
2351
|
+
return null;
|
|
2131
2352
|
}, (r) => {
|
|
2132
2353
|
controller._started = true;
|
|
2133
2354
|
WritableStreamDealWithRejection(stream, r);
|
|
2355
|
+
return null;
|
|
2134
2356
|
});
|
|
2135
2357
|
}
|
|
2136
2358
|
function SetUpWritableStreamDefaultControllerFromUnderlyingSink(stream, underlyingSink, highWaterMark, sizeAlgorithm) {
|
|
2137
2359
|
const controller = Object.create(WritableStreamDefaultController.prototype);
|
|
2138
|
-
let startAlgorithm
|
|
2139
|
-
let writeAlgorithm
|
|
2140
|
-
let closeAlgorithm
|
|
2141
|
-
let abortAlgorithm
|
|
2360
|
+
let startAlgorithm;
|
|
2361
|
+
let writeAlgorithm;
|
|
2362
|
+
let closeAlgorithm;
|
|
2363
|
+
let abortAlgorithm;
|
|
2142
2364
|
if (underlyingSink.start !== void 0) {
|
|
2143
2365
|
startAlgorithm = () => underlyingSink.start(controller);
|
|
2366
|
+
} else {
|
|
2367
|
+
startAlgorithm = () => void 0;
|
|
2144
2368
|
}
|
|
2145
2369
|
if (underlyingSink.write !== void 0) {
|
|
2146
2370
|
writeAlgorithm = (chunk) => underlyingSink.write(chunk, controller);
|
|
2371
|
+
} else {
|
|
2372
|
+
writeAlgorithm = () => promiseResolvedWith(void 0);
|
|
2147
2373
|
}
|
|
2148
2374
|
if (underlyingSink.close !== void 0) {
|
|
2149
2375
|
closeAlgorithm = () => underlyingSink.close();
|
|
2376
|
+
} else {
|
|
2377
|
+
closeAlgorithm = () => promiseResolvedWith(void 0);
|
|
2150
2378
|
}
|
|
2151
2379
|
if (underlyingSink.abort !== void 0) {
|
|
2152
2380
|
abortAlgorithm = (reason) => underlyingSink.abort(reason);
|
|
2381
|
+
} else {
|
|
2382
|
+
abortAlgorithm = () => promiseResolvedWith(void 0);
|
|
2153
2383
|
}
|
|
2154
2384
|
SetUpWritableStreamDefaultController(stream, controller, startAlgorithm, writeAlgorithm, closeAlgorithm, abortAlgorithm, highWaterMark, sizeAlgorithm);
|
|
2155
2385
|
}
|
|
@@ -2224,8 +2454,10 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2224
2454
|
WritableStreamDefaultControllerClearAlgorithms(controller);
|
|
2225
2455
|
uponPromise(sinkClosePromise, () => {
|
|
2226
2456
|
WritableStreamFinishInFlightClose(stream);
|
|
2457
|
+
return null;
|
|
2227
2458
|
}, (reason) => {
|
|
2228
2459
|
WritableStreamFinishInFlightCloseWithError(stream, reason);
|
|
2460
|
+
return null;
|
|
2229
2461
|
});
|
|
2230
2462
|
}
|
|
2231
2463
|
function WritableStreamDefaultControllerProcessWrite(controller, chunk) {
|
|
@@ -2241,11 +2473,13 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2241
2473
|
WritableStreamUpdateBackpressure(stream, backpressure);
|
|
2242
2474
|
}
|
|
2243
2475
|
WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
|
|
2476
|
+
return null;
|
|
2244
2477
|
}, (reason) => {
|
|
2245
2478
|
if (stream._state === "writable") {
|
|
2246
2479
|
WritableStreamDefaultControllerClearAlgorithms(controller);
|
|
2247
2480
|
}
|
|
2248
2481
|
WritableStreamFinishInFlightWriteWithError(stream, reason);
|
|
2482
|
+
return null;
|
|
2249
2483
|
});
|
|
2250
2484
|
}
|
|
2251
2485
|
function WritableStreamDefaultControllerGetBackpressure(controller) {
|
|
@@ -2346,19 +2580,36 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2346
2580
|
writer._readyPromise_reject = void 0;
|
|
2347
2581
|
writer._readyPromiseState = "fulfilled";
|
|
2348
2582
|
}
|
|
2349
|
-
|
|
2583
|
+
function getGlobals() {
|
|
2584
|
+
if (typeof globalThis !== "undefined") {
|
|
2585
|
+
return globalThis;
|
|
2586
|
+
} else if (typeof self !== "undefined") {
|
|
2587
|
+
return self;
|
|
2588
|
+
} else if (typeof global !== "undefined") {
|
|
2589
|
+
return global;
|
|
2590
|
+
}
|
|
2591
|
+
return void 0;
|
|
2592
|
+
}
|
|
2593
|
+
const globals = getGlobals();
|
|
2350
2594
|
function isDOMExceptionConstructor(ctor) {
|
|
2351
2595
|
if (!(typeof ctor === "function" || typeof ctor === "object")) {
|
|
2352
2596
|
return false;
|
|
2353
2597
|
}
|
|
2598
|
+
if (ctor.name !== "DOMException") {
|
|
2599
|
+
return false;
|
|
2600
|
+
}
|
|
2354
2601
|
try {
|
|
2355
2602
|
new ctor();
|
|
2356
2603
|
return true;
|
|
2357
|
-
} catch (
|
|
2604
|
+
} catch (_a2) {
|
|
2358
2605
|
return false;
|
|
2359
2606
|
}
|
|
2360
2607
|
}
|
|
2361
|
-
function
|
|
2608
|
+
function getFromGlobal() {
|
|
2609
|
+
const ctor = globals === null || globals === void 0 ? void 0 : globals.DOMException;
|
|
2610
|
+
return isDOMExceptionConstructor(ctor) ? ctor : void 0;
|
|
2611
|
+
}
|
|
2612
|
+
function createPolyfill() {
|
|
2362
2613
|
const ctor = function DOMException3(message, name) {
|
|
2363
2614
|
this.message = message || "";
|
|
2364
2615
|
this.name = name || "Error";
|
|
@@ -2366,11 +2617,12 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2366
2617
|
Error.captureStackTrace(this, this.constructor);
|
|
2367
2618
|
}
|
|
2368
2619
|
};
|
|
2620
|
+
setFunctionName(ctor, "DOMException");
|
|
2369
2621
|
ctor.prototype = Object.create(Error.prototype);
|
|
2370
2622
|
Object.defineProperty(ctor.prototype, "constructor", { value: ctor, writable: true, configurable: true });
|
|
2371
2623
|
return ctor;
|
|
2372
2624
|
}
|
|
2373
|
-
const
|
|
2625
|
+
const DOMException2 = getFromGlobal() || createPolyfill();
|
|
2374
2626
|
function ReadableStreamPipeTo(source, dest, preventClose, preventAbort, preventCancel, signal) {
|
|
2375
2627
|
const reader = AcquireReadableStreamDefaultReader(source);
|
|
2376
2628
|
const writer = AcquireWritableStreamDefaultWriter(dest);
|
|
@@ -2381,7 +2633,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2381
2633
|
let abortAlgorithm;
|
|
2382
2634
|
if (signal !== void 0) {
|
|
2383
2635
|
abortAlgorithm = () => {
|
|
2384
|
-
const error = new
|
|
2636
|
+
const error = signal.reason !== void 0 ? signal.reason : new DOMException2("Aborted", "AbortError");
|
|
2385
2637
|
const actions = [];
|
|
2386
2638
|
if (!preventAbort) {
|
|
2387
2639
|
actions.push(() => {
|
|
@@ -2442,6 +2694,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2442
2694
|
} else {
|
|
2443
2695
|
shutdown(true, storedError);
|
|
2444
2696
|
}
|
|
2697
|
+
return null;
|
|
2445
2698
|
});
|
|
2446
2699
|
isOrBecomesErrored(dest, writer._closedPromise, (storedError) => {
|
|
2447
2700
|
if (!preventCancel) {
|
|
@@ -2449,6 +2702,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2449
2702
|
} else {
|
|
2450
2703
|
shutdown(true, storedError);
|
|
2451
2704
|
}
|
|
2705
|
+
return null;
|
|
2452
2706
|
});
|
|
2453
2707
|
isOrBecomesClosed(source, reader._closedPromise, () => {
|
|
2454
2708
|
if (!preventClose) {
|
|
@@ -2456,6 +2710,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2456
2710
|
} else {
|
|
2457
2711
|
shutdown();
|
|
2458
2712
|
}
|
|
2713
|
+
return null;
|
|
2459
2714
|
});
|
|
2460
2715
|
if (WritableStreamCloseQueuedOrInFlight(dest) || dest._state === "closed") {
|
|
2461
2716
|
const destClosed = new TypeError("the destination writable stream closed before all data could be piped to it");
|
|
@@ -2496,6 +2751,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2496
2751
|
}
|
|
2497
2752
|
function doTheRest() {
|
|
2498
2753
|
uponPromise(action(), () => finalize(originalIsError, originalError), (newError) => finalize(true, newError));
|
|
2754
|
+
return null;
|
|
2499
2755
|
}
|
|
2500
2756
|
}
|
|
2501
2757
|
function shutdown(isError, error) {
|
|
@@ -2520,6 +2776,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2520
2776
|
} else {
|
|
2521
2777
|
resolve(void 0);
|
|
2522
2778
|
}
|
|
2779
|
+
return null;
|
|
2523
2780
|
}
|
|
2524
2781
|
});
|
|
2525
2782
|
}
|
|
@@ -2592,6 +2849,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2592
2849
|
ReadableStreamDefaultControllerCallPullIfNeeded(this);
|
|
2593
2850
|
}
|
|
2594
2851
|
}
|
|
2852
|
+
/** @internal */
|
|
2853
|
+
[ReleaseSteps]() {
|
|
2854
|
+
}
|
|
2595
2855
|
}
|
|
2596
2856
|
Object.defineProperties(ReadableStreamDefaultController.prototype, {
|
|
2597
2857
|
close: { enumerable: true },
|
|
@@ -2599,8 +2859,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2599
2859
|
error: { enumerable: true },
|
|
2600
2860
|
desiredSize: { enumerable: true }
|
|
2601
2861
|
});
|
|
2602
|
-
|
|
2603
|
-
|
|
2862
|
+
setFunctionName(ReadableStreamDefaultController.prototype.close, "close");
|
|
2863
|
+
setFunctionName(ReadableStreamDefaultController.prototype.enqueue, "enqueue");
|
|
2864
|
+
setFunctionName(ReadableStreamDefaultController.prototype.error, "error");
|
|
2865
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
2866
|
+
Object.defineProperty(ReadableStreamDefaultController.prototype, Symbol.toStringTag, {
|
|
2604
2867
|
value: "ReadableStreamDefaultController",
|
|
2605
2868
|
configurable: true
|
|
2606
2869
|
});
|
|
@@ -2631,8 +2894,10 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2631
2894
|
controller._pullAgain = false;
|
|
2632
2895
|
ReadableStreamDefaultControllerCallPullIfNeeded(controller);
|
|
2633
2896
|
}
|
|
2897
|
+
return null;
|
|
2634
2898
|
}, (e) => {
|
|
2635
2899
|
ReadableStreamDefaultControllerError(controller, e);
|
|
2900
|
+
return null;
|
|
2636
2901
|
});
|
|
2637
2902
|
}
|
|
2638
2903
|
function ReadableStreamDefaultControllerShouldCallPull(controller) {
|
|
@@ -2742,23 +3007,31 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2742
3007
|
uponPromise(promiseResolvedWith(startResult), () => {
|
|
2743
3008
|
controller._started = true;
|
|
2744
3009
|
ReadableStreamDefaultControllerCallPullIfNeeded(controller);
|
|
3010
|
+
return null;
|
|
2745
3011
|
}, (r) => {
|
|
2746
3012
|
ReadableStreamDefaultControllerError(controller, r);
|
|
3013
|
+
return null;
|
|
2747
3014
|
});
|
|
2748
3015
|
}
|
|
2749
3016
|
function SetUpReadableStreamDefaultControllerFromUnderlyingSource(stream, underlyingSource, highWaterMark, sizeAlgorithm) {
|
|
2750
3017
|
const controller = Object.create(ReadableStreamDefaultController.prototype);
|
|
2751
|
-
let startAlgorithm
|
|
2752
|
-
let pullAlgorithm
|
|
2753
|
-
let cancelAlgorithm
|
|
3018
|
+
let startAlgorithm;
|
|
3019
|
+
let pullAlgorithm;
|
|
3020
|
+
let cancelAlgorithm;
|
|
2754
3021
|
if (underlyingSource.start !== void 0) {
|
|
2755
3022
|
startAlgorithm = () => underlyingSource.start(controller);
|
|
3023
|
+
} else {
|
|
3024
|
+
startAlgorithm = () => void 0;
|
|
2756
3025
|
}
|
|
2757
3026
|
if (underlyingSource.pull !== void 0) {
|
|
2758
3027
|
pullAlgorithm = () => underlyingSource.pull(controller);
|
|
3028
|
+
} else {
|
|
3029
|
+
pullAlgorithm = () => promiseResolvedWith(void 0);
|
|
2759
3030
|
}
|
|
2760
3031
|
if (underlyingSource.cancel !== void 0) {
|
|
2761
3032
|
cancelAlgorithm = (reason) => underlyingSource.cancel(reason);
|
|
3033
|
+
} else {
|
|
3034
|
+
cancelAlgorithm = () => promiseResolvedWith(void 0);
|
|
2762
3035
|
}
|
|
2763
3036
|
SetUpReadableStreamDefaultController(stream, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, sizeAlgorithm);
|
|
2764
3037
|
}
|
|
@@ -2793,7 +3066,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2793
3066
|
reading = true;
|
|
2794
3067
|
const readRequest = {
|
|
2795
3068
|
_chunkSteps: (chunk) => {
|
|
2796
|
-
|
|
3069
|
+
_queueMicrotask(() => {
|
|
2797
3070
|
readAgain = false;
|
|
2798
3071
|
const chunk1 = chunk;
|
|
2799
3072
|
const chunk2 = chunk;
|
|
@@ -2858,6 +3131,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2858
3131
|
if (!canceled1 || !canceled2) {
|
|
2859
3132
|
resolveCancelPromise(void 0);
|
|
2860
3133
|
}
|
|
3134
|
+
return null;
|
|
2861
3135
|
});
|
|
2862
3136
|
return [branch1, branch2];
|
|
2863
3137
|
}
|
|
@@ -2879,13 +3153,14 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2879
3153
|
function forwardReaderError(thisReader) {
|
|
2880
3154
|
uponRejection(thisReader._closedPromise, (r) => {
|
|
2881
3155
|
if (thisReader !== reader) {
|
|
2882
|
-
return;
|
|
3156
|
+
return null;
|
|
2883
3157
|
}
|
|
2884
3158
|
ReadableByteStreamControllerError(branch1._readableStreamController, r);
|
|
2885
3159
|
ReadableByteStreamControllerError(branch2._readableStreamController, r);
|
|
2886
3160
|
if (!canceled1 || !canceled2) {
|
|
2887
3161
|
resolveCancelPromise(void 0);
|
|
2888
3162
|
}
|
|
3163
|
+
return null;
|
|
2889
3164
|
});
|
|
2890
3165
|
}
|
|
2891
3166
|
function pullWithDefaultReader() {
|
|
@@ -2896,7 +3171,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2896
3171
|
}
|
|
2897
3172
|
const readRequest = {
|
|
2898
3173
|
_chunkSteps: (chunk) => {
|
|
2899
|
-
|
|
3174
|
+
_queueMicrotask(() => {
|
|
2900
3175
|
readAgainForBranch1 = false;
|
|
2901
3176
|
readAgainForBranch2 = false;
|
|
2902
3177
|
const chunk1 = chunk;
|
|
@@ -2959,7 +3234,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
2959
3234
|
const otherBranch = forBranch2 ? branch1 : branch2;
|
|
2960
3235
|
const readIntoRequest = {
|
|
2961
3236
|
_chunkSteps: (chunk) => {
|
|
2962
|
-
|
|
3237
|
+
_queueMicrotask(() => {
|
|
2963
3238
|
readAgainForBranch1 = false;
|
|
2964
3239
|
readAgainForBranch2 = false;
|
|
2965
3240
|
const byobCanceled = forBranch2 ? canceled2 : canceled1;
|
|
@@ -3015,7 +3290,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3015
3290
|
reading = false;
|
|
3016
3291
|
}
|
|
3017
3292
|
};
|
|
3018
|
-
ReadableStreamBYOBReaderRead(reader, view, readIntoRequest);
|
|
3293
|
+
ReadableStreamBYOBReaderRead(reader, view, 1, readIntoRequest);
|
|
3019
3294
|
}
|
|
3020
3295
|
function pull1Algorithm() {
|
|
3021
3296
|
if (reading) {
|
|
@@ -3073,6 +3348,100 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3073
3348
|
forwardReaderError(reader);
|
|
3074
3349
|
return [branch1, branch2];
|
|
3075
3350
|
}
|
|
3351
|
+
function isReadableStreamLike(stream) {
|
|
3352
|
+
return typeIsObject(stream) && typeof stream.getReader !== "undefined";
|
|
3353
|
+
}
|
|
3354
|
+
function ReadableStreamFrom(source) {
|
|
3355
|
+
if (isReadableStreamLike(source)) {
|
|
3356
|
+
return ReadableStreamFromDefaultReader(source.getReader());
|
|
3357
|
+
}
|
|
3358
|
+
return ReadableStreamFromIterable(source);
|
|
3359
|
+
}
|
|
3360
|
+
function ReadableStreamFromIterable(asyncIterable) {
|
|
3361
|
+
let stream;
|
|
3362
|
+
const iteratorRecord = GetIterator(asyncIterable, "async");
|
|
3363
|
+
const startAlgorithm = noop2;
|
|
3364
|
+
function pullAlgorithm() {
|
|
3365
|
+
let nextResult;
|
|
3366
|
+
try {
|
|
3367
|
+
nextResult = IteratorNext(iteratorRecord);
|
|
3368
|
+
} catch (e) {
|
|
3369
|
+
return promiseRejectedWith(e);
|
|
3370
|
+
}
|
|
3371
|
+
const nextPromise = promiseResolvedWith(nextResult);
|
|
3372
|
+
return transformPromiseWith(nextPromise, (iterResult) => {
|
|
3373
|
+
if (!typeIsObject(iterResult)) {
|
|
3374
|
+
throw new TypeError("The promise returned by the iterator.next() method must fulfill with an object");
|
|
3375
|
+
}
|
|
3376
|
+
const done = IteratorComplete(iterResult);
|
|
3377
|
+
if (done) {
|
|
3378
|
+
ReadableStreamDefaultControllerClose(stream._readableStreamController);
|
|
3379
|
+
} else {
|
|
3380
|
+
const value = IteratorValue(iterResult);
|
|
3381
|
+
ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);
|
|
3382
|
+
}
|
|
3383
|
+
});
|
|
3384
|
+
}
|
|
3385
|
+
function cancelAlgorithm(reason) {
|
|
3386
|
+
const iterator = iteratorRecord.iterator;
|
|
3387
|
+
let returnMethod;
|
|
3388
|
+
try {
|
|
3389
|
+
returnMethod = GetMethod(iterator, "return");
|
|
3390
|
+
} catch (e) {
|
|
3391
|
+
return promiseRejectedWith(e);
|
|
3392
|
+
}
|
|
3393
|
+
if (returnMethod === void 0) {
|
|
3394
|
+
return promiseResolvedWith(void 0);
|
|
3395
|
+
}
|
|
3396
|
+
let returnResult;
|
|
3397
|
+
try {
|
|
3398
|
+
returnResult = reflectCall(returnMethod, iterator, [reason]);
|
|
3399
|
+
} catch (e) {
|
|
3400
|
+
return promiseRejectedWith(e);
|
|
3401
|
+
}
|
|
3402
|
+
const returnPromise = promiseResolvedWith(returnResult);
|
|
3403
|
+
return transformPromiseWith(returnPromise, (iterResult) => {
|
|
3404
|
+
if (!typeIsObject(iterResult)) {
|
|
3405
|
+
throw new TypeError("The promise returned by the iterator.return() method must fulfill with an object");
|
|
3406
|
+
}
|
|
3407
|
+
return void 0;
|
|
3408
|
+
});
|
|
3409
|
+
}
|
|
3410
|
+
stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);
|
|
3411
|
+
return stream;
|
|
3412
|
+
}
|
|
3413
|
+
function ReadableStreamFromDefaultReader(reader) {
|
|
3414
|
+
let stream;
|
|
3415
|
+
const startAlgorithm = noop2;
|
|
3416
|
+
function pullAlgorithm() {
|
|
3417
|
+
let readPromise;
|
|
3418
|
+
try {
|
|
3419
|
+
readPromise = reader.read();
|
|
3420
|
+
} catch (e) {
|
|
3421
|
+
return promiseRejectedWith(e);
|
|
3422
|
+
}
|
|
3423
|
+
return transformPromiseWith(readPromise, (readResult) => {
|
|
3424
|
+
if (!typeIsObject(readResult)) {
|
|
3425
|
+
throw new TypeError("The promise returned by the reader.read() method must fulfill with an object");
|
|
3426
|
+
}
|
|
3427
|
+
if (readResult.done) {
|
|
3428
|
+
ReadableStreamDefaultControllerClose(stream._readableStreamController);
|
|
3429
|
+
} else {
|
|
3430
|
+
const value = readResult.value;
|
|
3431
|
+
ReadableStreamDefaultControllerEnqueue(stream._readableStreamController, value);
|
|
3432
|
+
}
|
|
3433
|
+
});
|
|
3434
|
+
}
|
|
3435
|
+
function cancelAlgorithm(reason) {
|
|
3436
|
+
try {
|
|
3437
|
+
return promiseResolvedWith(reader.cancel(reason));
|
|
3438
|
+
} catch (e) {
|
|
3439
|
+
return promiseRejectedWith(e);
|
|
3440
|
+
}
|
|
3441
|
+
}
|
|
3442
|
+
stream = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, 0);
|
|
3443
|
+
return stream;
|
|
3444
|
+
}
|
|
3076
3445
|
function convertUnderlyingDefaultOrByteSource(source, context) {
|
|
3077
3446
|
assertDictionary(source, context);
|
|
3078
3447
|
const original = source;
|
|
@@ -3108,20 +3477,6 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3108
3477
|
}
|
|
3109
3478
|
return type;
|
|
3110
3479
|
}
|
|
3111
|
-
function convertReaderOptions(options, context) {
|
|
3112
|
-
assertDictionary(options, context);
|
|
3113
|
-
const mode = options === null || options === void 0 ? void 0 : options.mode;
|
|
3114
|
-
return {
|
|
3115
|
-
mode: mode === void 0 ? void 0 : convertReadableStreamReaderMode(mode, `${context} has member 'mode' that`)
|
|
3116
|
-
};
|
|
3117
|
-
}
|
|
3118
|
-
function convertReadableStreamReaderMode(mode, context) {
|
|
3119
|
-
mode = `${mode}`;
|
|
3120
|
-
if (mode !== "byob") {
|
|
3121
|
-
throw new TypeError(`${context} '${mode}' is not a valid enumeration value for ReadableStreamReaderMode`);
|
|
3122
|
-
}
|
|
3123
|
-
return mode;
|
|
3124
|
-
}
|
|
3125
3480
|
function convertIteratorOptions(options, context) {
|
|
3126
3481
|
assertDictionary(options, context);
|
|
3127
3482
|
const preventCancel = options === null || options === void 0 ? void 0 : options.preventCancel;
|
|
@@ -3280,7 +3635,22 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3280
3635
|
const options = convertIteratorOptions(rawOptions, "First parameter");
|
|
3281
3636
|
return AcquireReadableStreamAsyncIterator(this, options.preventCancel);
|
|
3282
3637
|
}
|
|
3638
|
+
[SymbolAsyncIterator](options) {
|
|
3639
|
+
return this.values(options);
|
|
3640
|
+
}
|
|
3641
|
+
/**
|
|
3642
|
+
* Creates a new ReadableStream wrapping the provided iterable or async iterable.
|
|
3643
|
+
*
|
|
3644
|
+
* This can be used to adapt various kinds of objects into a readable stream,
|
|
3645
|
+
* such as an array, an async generator, or a Node.js readable stream.
|
|
3646
|
+
*/
|
|
3647
|
+
static from(asyncIterable) {
|
|
3648
|
+
return ReadableStreamFrom(asyncIterable);
|
|
3649
|
+
}
|
|
3283
3650
|
}
|
|
3651
|
+
Object.defineProperties(ReadableStream2, {
|
|
3652
|
+
from: { enumerable: true }
|
|
3653
|
+
});
|
|
3284
3654
|
Object.defineProperties(ReadableStream2.prototype, {
|
|
3285
3655
|
cancel: { enumerable: true },
|
|
3286
3656
|
getReader: { enumerable: true },
|
|
@@ -3290,19 +3660,24 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3290
3660
|
values: { enumerable: true },
|
|
3291
3661
|
locked: { enumerable: true }
|
|
3292
3662
|
});
|
|
3293
|
-
|
|
3294
|
-
|
|
3663
|
+
setFunctionName(ReadableStream2.from, "from");
|
|
3664
|
+
setFunctionName(ReadableStream2.prototype.cancel, "cancel");
|
|
3665
|
+
setFunctionName(ReadableStream2.prototype.getReader, "getReader");
|
|
3666
|
+
setFunctionName(ReadableStream2.prototype.pipeThrough, "pipeThrough");
|
|
3667
|
+
setFunctionName(ReadableStream2.prototype.pipeTo, "pipeTo");
|
|
3668
|
+
setFunctionName(ReadableStream2.prototype.tee, "tee");
|
|
3669
|
+
setFunctionName(ReadableStream2.prototype.values, "values");
|
|
3670
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
3671
|
+
Object.defineProperty(ReadableStream2.prototype, Symbol.toStringTag, {
|
|
3295
3672
|
value: "ReadableStream",
|
|
3296
3673
|
configurable: true
|
|
3297
3674
|
});
|
|
3298
3675
|
}
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3304
|
-
});
|
|
3305
|
-
}
|
|
3676
|
+
Object.defineProperty(ReadableStream2.prototype, SymbolAsyncIterator, {
|
|
3677
|
+
value: ReadableStream2.prototype.values,
|
|
3678
|
+
writable: true,
|
|
3679
|
+
configurable: true
|
|
3680
|
+
});
|
|
3306
3681
|
function CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark = 1, sizeAlgorithm = () => 1) {
|
|
3307
3682
|
const stream = Object.create(ReadableStream2.prototype);
|
|
3308
3683
|
InitializeReadableStream(stream);
|
|
@@ -3349,10 +3724,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3349
3724
|
ReadableStreamClose(stream);
|
|
3350
3725
|
const reader = stream._reader;
|
|
3351
3726
|
if (reader !== void 0 && IsReadableStreamBYOBReader(reader)) {
|
|
3352
|
-
reader._readIntoRequests
|
|
3727
|
+
const readIntoRequests = reader._readIntoRequests;
|
|
3728
|
+
reader._readIntoRequests = new SimpleQueue();
|
|
3729
|
+
readIntoRequests.forEach((readIntoRequest) => {
|
|
3353
3730
|
readIntoRequest._closeSteps(void 0);
|
|
3354
3731
|
});
|
|
3355
|
-
reader._readIntoRequests = new SimpleQueue();
|
|
3356
3732
|
}
|
|
3357
3733
|
const sourceCancelPromise = stream._readableStreamController[CancelSteps](reason);
|
|
3358
3734
|
return transformPromiseWith(sourceCancelPromise, noop2);
|
|
@@ -3365,10 +3741,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3365
3741
|
}
|
|
3366
3742
|
defaultReaderClosedPromiseResolve(reader);
|
|
3367
3743
|
if (IsReadableStreamDefaultReader(reader)) {
|
|
3368
|
-
reader._readRequests
|
|
3744
|
+
const readRequests = reader._readRequests;
|
|
3745
|
+
reader._readRequests = new SimpleQueue();
|
|
3746
|
+
readRequests.forEach((readRequest) => {
|
|
3369
3747
|
readRequest._closeSteps();
|
|
3370
3748
|
});
|
|
3371
|
-
reader._readRequests = new SimpleQueue();
|
|
3372
3749
|
}
|
|
3373
3750
|
}
|
|
3374
3751
|
function ReadableStreamError(stream, e) {
|
|
@@ -3380,15 +3757,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3380
3757
|
}
|
|
3381
3758
|
defaultReaderClosedPromiseReject(reader, e);
|
|
3382
3759
|
if (IsReadableStreamDefaultReader(reader)) {
|
|
3383
|
-
reader
|
|
3384
|
-
readRequest._errorSteps(e);
|
|
3385
|
-
});
|
|
3386
|
-
reader._readRequests = new SimpleQueue();
|
|
3760
|
+
ReadableStreamDefaultReaderErrorReadRequests(reader, e);
|
|
3387
3761
|
} else {
|
|
3388
|
-
reader
|
|
3389
|
-
readIntoRequest._errorSteps(e);
|
|
3390
|
-
});
|
|
3391
|
-
reader._readIntoRequests = new SimpleQueue();
|
|
3762
|
+
ReadableStreamBYOBReaderErrorReadIntoRequests(reader, e);
|
|
3392
3763
|
}
|
|
3393
3764
|
}
|
|
3394
3765
|
function streamBrandCheckException$1(name) {
|
|
@@ -3405,13 +3776,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3405
3776
|
const byteLengthSizeFunction = (chunk) => {
|
|
3406
3777
|
return chunk.byteLength;
|
|
3407
3778
|
};
|
|
3408
|
-
|
|
3409
|
-
Object.defineProperty(byteLengthSizeFunction, "name", {
|
|
3410
|
-
value: "size",
|
|
3411
|
-
configurable: true
|
|
3412
|
-
});
|
|
3413
|
-
} catch (_a) {
|
|
3414
|
-
}
|
|
3779
|
+
setFunctionName(byteLengthSizeFunction, "size");
|
|
3415
3780
|
class ByteLengthQueuingStrategy {
|
|
3416
3781
|
constructor(options) {
|
|
3417
3782
|
assertRequiredArgument(options, 1, "ByteLengthQueuingStrategy");
|
|
@@ -3441,8 +3806,8 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3441
3806
|
highWaterMark: { enumerable: true },
|
|
3442
3807
|
size: { enumerable: true }
|
|
3443
3808
|
});
|
|
3444
|
-
if (typeof
|
|
3445
|
-
Object.defineProperty(ByteLengthQueuingStrategy.prototype,
|
|
3809
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
3810
|
+
Object.defineProperty(ByteLengthQueuingStrategy.prototype, Symbol.toStringTag, {
|
|
3446
3811
|
value: "ByteLengthQueuingStrategy",
|
|
3447
3812
|
configurable: true
|
|
3448
3813
|
});
|
|
@@ -3462,13 +3827,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3462
3827
|
const countSizeFunction = () => {
|
|
3463
3828
|
return 1;
|
|
3464
3829
|
};
|
|
3465
|
-
|
|
3466
|
-
Object.defineProperty(countSizeFunction, "name", {
|
|
3467
|
-
value: "size",
|
|
3468
|
-
configurable: true
|
|
3469
|
-
});
|
|
3470
|
-
} catch (_a) {
|
|
3471
|
-
}
|
|
3830
|
+
setFunctionName(countSizeFunction, "size");
|
|
3472
3831
|
class CountQueuingStrategy {
|
|
3473
3832
|
constructor(options) {
|
|
3474
3833
|
assertRequiredArgument(options, 1, "CountQueuingStrategy");
|
|
@@ -3499,8 +3858,8 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3499
3858
|
highWaterMark: { enumerable: true },
|
|
3500
3859
|
size: { enumerable: true }
|
|
3501
3860
|
});
|
|
3502
|
-
if (typeof
|
|
3503
|
-
Object.defineProperty(CountQueuingStrategy.prototype,
|
|
3861
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
3862
|
+
Object.defineProperty(CountQueuingStrategy.prototype, Symbol.toStringTag, {
|
|
3504
3863
|
value: "CountQueuingStrategy",
|
|
3505
3864
|
configurable: true
|
|
3506
3865
|
});
|
|
@@ -3519,12 +3878,14 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3519
3878
|
}
|
|
3520
3879
|
function convertTransformer(original, context) {
|
|
3521
3880
|
assertDictionary(original, context);
|
|
3881
|
+
const cancel = original === null || original === void 0 ? void 0 : original.cancel;
|
|
3522
3882
|
const flush = original === null || original === void 0 ? void 0 : original.flush;
|
|
3523
3883
|
const readableType = original === null || original === void 0 ? void 0 : original.readableType;
|
|
3524
3884
|
const start = original === null || original === void 0 ? void 0 : original.start;
|
|
3525
3885
|
const transform = original === null || original === void 0 ? void 0 : original.transform;
|
|
3526
3886
|
const writableType = original === null || original === void 0 ? void 0 : original.writableType;
|
|
3527
3887
|
return {
|
|
3888
|
+
cancel: cancel === void 0 ? void 0 : convertTransformerCancelCallback(cancel, original, `${context} has member 'cancel' that`),
|
|
3528
3889
|
flush: flush === void 0 ? void 0 : convertTransformerFlushCallback(flush, original, `${context} has member 'flush' that`),
|
|
3529
3890
|
readableType,
|
|
3530
3891
|
start: start === void 0 ? void 0 : convertTransformerStartCallback(start, original, `${context} has member 'start' that`),
|
|
@@ -3544,6 +3905,10 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3544
3905
|
assertFunction(fn, context);
|
|
3545
3906
|
return (chunk, controller) => promiseCall(fn, original, [chunk, controller]);
|
|
3546
3907
|
}
|
|
3908
|
+
function convertTransformerCancelCallback(fn, original, context) {
|
|
3909
|
+
assertFunction(fn, context);
|
|
3910
|
+
return (reason) => promiseCall(fn, original, [reason]);
|
|
3911
|
+
}
|
|
3547
3912
|
class TransformStream {
|
|
3548
3913
|
constructor(rawTransformer = {}, rawWritableStrategy = {}, rawReadableStrategy = {}) {
|
|
3549
3914
|
if (rawTransformer === void 0) {
|
|
@@ -3597,8 +3962,8 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3597
3962
|
readable: { enumerable: true },
|
|
3598
3963
|
writable: { enumerable: true }
|
|
3599
3964
|
});
|
|
3600
|
-
if (typeof
|
|
3601
|
-
Object.defineProperty(TransformStream.prototype,
|
|
3965
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
3966
|
+
Object.defineProperty(TransformStream.prototype, Symbol.toStringTag, {
|
|
3602
3967
|
value: "TransformStream",
|
|
3603
3968
|
configurable: true
|
|
3604
3969
|
});
|
|
@@ -3621,8 +3986,7 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3621
3986
|
return TransformStreamDefaultSourcePullAlgorithm(stream);
|
|
3622
3987
|
}
|
|
3623
3988
|
function cancelAlgorithm(reason) {
|
|
3624
|
-
|
|
3625
|
-
return promiseResolvedWith(void 0);
|
|
3989
|
+
return TransformStreamDefaultSourceCancelAlgorithm(stream, reason);
|
|
3626
3990
|
}
|
|
3627
3991
|
stream._readable = CreateReadableStream(startAlgorithm, pullAlgorithm, cancelAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
|
|
3628
3992
|
stream._backpressure = void 0;
|
|
@@ -3647,6 +4011,9 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3647
4011
|
function TransformStreamErrorWritableAndUnblockWrite(stream, e) {
|
|
3648
4012
|
TransformStreamDefaultControllerClearAlgorithms(stream._transformStreamController);
|
|
3649
4013
|
WritableStreamDefaultControllerErrorIfNeeded(stream._writable._writableStreamController, e);
|
|
4014
|
+
TransformStreamUnblockWrite(stream);
|
|
4015
|
+
}
|
|
4016
|
+
function TransformStreamUnblockWrite(stream) {
|
|
3650
4017
|
if (stream._backpressure) {
|
|
3651
4018
|
TransformStreamSetBackpressure(stream, false);
|
|
3652
4019
|
}
|
|
@@ -3707,8 +4074,11 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3707
4074
|
terminate: { enumerable: true },
|
|
3708
4075
|
desiredSize: { enumerable: true }
|
|
3709
4076
|
});
|
|
3710
|
-
|
|
3711
|
-
|
|
4077
|
+
setFunctionName(TransformStreamDefaultController.prototype.enqueue, "enqueue");
|
|
4078
|
+
setFunctionName(TransformStreamDefaultController.prototype.error, "error");
|
|
4079
|
+
setFunctionName(TransformStreamDefaultController.prototype.terminate, "terminate");
|
|
4080
|
+
if (typeof Symbol.toStringTag === "symbol") {
|
|
4081
|
+
Object.defineProperty(TransformStreamDefaultController.prototype, Symbol.toStringTag, {
|
|
3712
4082
|
value: "TransformStreamDefaultController",
|
|
3713
4083
|
configurable: true
|
|
3714
4084
|
});
|
|
@@ -3722,34 +4092,49 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3722
4092
|
}
|
|
3723
4093
|
return x2 instanceof TransformStreamDefaultController;
|
|
3724
4094
|
}
|
|
3725
|
-
function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm) {
|
|
4095
|
+
function SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm) {
|
|
3726
4096
|
controller._controlledTransformStream = stream;
|
|
3727
4097
|
stream._transformStreamController = controller;
|
|
3728
4098
|
controller._transformAlgorithm = transformAlgorithm;
|
|
3729
4099
|
controller._flushAlgorithm = flushAlgorithm;
|
|
4100
|
+
controller._cancelAlgorithm = cancelAlgorithm;
|
|
4101
|
+
controller._finishPromise = void 0;
|
|
4102
|
+
controller._finishPromise_resolve = void 0;
|
|
4103
|
+
controller._finishPromise_reject = void 0;
|
|
3730
4104
|
}
|
|
3731
4105
|
function SetUpTransformStreamDefaultControllerFromTransformer(stream, transformer) {
|
|
3732
4106
|
const controller = Object.create(TransformStreamDefaultController.prototype);
|
|
3733
|
-
let transformAlgorithm
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
return promiseResolvedWith(void 0);
|
|
3737
|
-
} catch (transformResultE) {
|
|
3738
|
-
return promiseRejectedWith(transformResultE);
|
|
3739
|
-
}
|
|
3740
|
-
};
|
|
3741
|
-
let flushAlgorithm = () => promiseResolvedWith(void 0);
|
|
4107
|
+
let transformAlgorithm;
|
|
4108
|
+
let flushAlgorithm;
|
|
4109
|
+
let cancelAlgorithm;
|
|
3742
4110
|
if (transformer.transform !== void 0) {
|
|
3743
4111
|
transformAlgorithm = (chunk) => transformer.transform(chunk, controller);
|
|
4112
|
+
} else {
|
|
4113
|
+
transformAlgorithm = (chunk) => {
|
|
4114
|
+
try {
|
|
4115
|
+
TransformStreamDefaultControllerEnqueue(controller, chunk);
|
|
4116
|
+
return promiseResolvedWith(void 0);
|
|
4117
|
+
} catch (transformResultE) {
|
|
4118
|
+
return promiseRejectedWith(transformResultE);
|
|
4119
|
+
}
|
|
4120
|
+
};
|
|
3744
4121
|
}
|
|
3745
4122
|
if (transformer.flush !== void 0) {
|
|
3746
4123
|
flushAlgorithm = () => transformer.flush(controller);
|
|
4124
|
+
} else {
|
|
4125
|
+
flushAlgorithm = () => promiseResolvedWith(void 0);
|
|
4126
|
+
}
|
|
4127
|
+
if (transformer.cancel !== void 0) {
|
|
4128
|
+
cancelAlgorithm = (reason) => transformer.cancel(reason);
|
|
4129
|
+
} else {
|
|
4130
|
+
cancelAlgorithm = () => promiseResolvedWith(void 0);
|
|
3747
4131
|
}
|
|
3748
|
-
SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm);
|
|
4132
|
+
SetUpTransformStreamDefaultController(stream, controller, transformAlgorithm, flushAlgorithm, cancelAlgorithm);
|
|
3749
4133
|
}
|
|
3750
4134
|
function TransformStreamDefaultControllerClearAlgorithms(controller) {
|
|
3751
4135
|
controller._transformAlgorithm = void 0;
|
|
3752
4136
|
controller._flushAlgorithm = void 0;
|
|
4137
|
+
controller._cancelAlgorithm = void 0;
|
|
3753
4138
|
}
|
|
3754
4139
|
function TransformStreamDefaultControllerEnqueue(controller, chunk) {
|
|
3755
4140
|
const stream = controller._controlledTransformStream;
|
|
@@ -3801,31 +4186,112 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3801
4186
|
return TransformStreamDefaultControllerPerformTransform(controller, chunk);
|
|
3802
4187
|
}
|
|
3803
4188
|
function TransformStreamDefaultSinkAbortAlgorithm(stream, reason) {
|
|
3804
|
-
|
|
3805
|
-
|
|
4189
|
+
const controller = stream._transformStreamController;
|
|
4190
|
+
if (controller._finishPromise !== void 0) {
|
|
4191
|
+
return controller._finishPromise;
|
|
4192
|
+
}
|
|
4193
|
+
const readable = stream._readable;
|
|
4194
|
+
controller._finishPromise = newPromise((resolve, reject) => {
|
|
4195
|
+
controller._finishPromise_resolve = resolve;
|
|
4196
|
+
controller._finishPromise_reject = reject;
|
|
4197
|
+
});
|
|
4198
|
+
const cancelPromise = controller._cancelAlgorithm(reason);
|
|
4199
|
+
TransformStreamDefaultControllerClearAlgorithms(controller);
|
|
4200
|
+
uponPromise(cancelPromise, () => {
|
|
4201
|
+
if (readable._state === "errored") {
|
|
4202
|
+
defaultControllerFinishPromiseReject(controller, readable._storedError);
|
|
4203
|
+
} else {
|
|
4204
|
+
ReadableStreamDefaultControllerError(readable._readableStreamController, reason);
|
|
4205
|
+
defaultControllerFinishPromiseResolve(controller);
|
|
4206
|
+
}
|
|
4207
|
+
return null;
|
|
4208
|
+
}, (r) => {
|
|
4209
|
+
ReadableStreamDefaultControllerError(readable._readableStreamController, r);
|
|
4210
|
+
defaultControllerFinishPromiseReject(controller, r);
|
|
4211
|
+
return null;
|
|
4212
|
+
});
|
|
4213
|
+
return controller._finishPromise;
|
|
3806
4214
|
}
|
|
3807
4215
|
function TransformStreamDefaultSinkCloseAlgorithm(stream) {
|
|
3808
|
-
const readable = stream._readable;
|
|
3809
4216
|
const controller = stream._transformStreamController;
|
|
4217
|
+
if (controller._finishPromise !== void 0) {
|
|
4218
|
+
return controller._finishPromise;
|
|
4219
|
+
}
|
|
4220
|
+
const readable = stream._readable;
|
|
4221
|
+
controller._finishPromise = newPromise((resolve, reject) => {
|
|
4222
|
+
controller._finishPromise_resolve = resolve;
|
|
4223
|
+
controller._finishPromise_reject = reject;
|
|
4224
|
+
});
|
|
3810
4225
|
const flushPromise = controller._flushAlgorithm();
|
|
3811
4226
|
TransformStreamDefaultControllerClearAlgorithms(controller);
|
|
3812
|
-
|
|
4227
|
+
uponPromise(flushPromise, () => {
|
|
3813
4228
|
if (readable._state === "errored") {
|
|
3814
|
-
|
|
4229
|
+
defaultControllerFinishPromiseReject(controller, readable._storedError);
|
|
4230
|
+
} else {
|
|
4231
|
+
ReadableStreamDefaultControllerClose(readable._readableStreamController);
|
|
4232
|
+
defaultControllerFinishPromiseResolve(controller);
|
|
3815
4233
|
}
|
|
3816
|
-
|
|
4234
|
+
return null;
|
|
3817
4235
|
}, (r) => {
|
|
3818
|
-
|
|
3819
|
-
|
|
4236
|
+
ReadableStreamDefaultControllerError(readable._readableStreamController, r);
|
|
4237
|
+
defaultControllerFinishPromiseReject(controller, r);
|
|
4238
|
+
return null;
|
|
3820
4239
|
});
|
|
4240
|
+
return controller._finishPromise;
|
|
3821
4241
|
}
|
|
3822
4242
|
function TransformStreamDefaultSourcePullAlgorithm(stream) {
|
|
3823
4243
|
TransformStreamSetBackpressure(stream, false);
|
|
3824
4244
|
return stream._backpressureChangePromise;
|
|
3825
4245
|
}
|
|
4246
|
+
function TransformStreamDefaultSourceCancelAlgorithm(stream, reason) {
|
|
4247
|
+
const controller = stream._transformStreamController;
|
|
4248
|
+
if (controller._finishPromise !== void 0) {
|
|
4249
|
+
return controller._finishPromise;
|
|
4250
|
+
}
|
|
4251
|
+
const writable = stream._writable;
|
|
4252
|
+
controller._finishPromise = newPromise((resolve, reject) => {
|
|
4253
|
+
controller._finishPromise_resolve = resolve;
|
|
4254
|
+
controller._finishPromise_reject = reject;
|
|
4255
|
+
});
|
|
4256
|
+
const cancelPromise = controller._cancelAlgorithm(reason);
|
|
4257
|
+
TransformStreamDefaultControllerClearAlgorithms(controller);
|
|
4258
|
+
uponPromise(cancelPromise, () => {
|
|
4259
|
+
if (writable._state === "errored") {
|
|
4260
|
+
defaultControllerFinishPromiseReject(controller, writable._storedError);
|
|
4261
|
+
} else {
|
|
4262
|
+
WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, reason);
|
|
4263
|
+
TransformStreamUnblockWrite(stream);
|
|
4264
|
+
defaultControllerFinishPromiseResolve(controller);
|
|
4265
|
+
}
|
|
4266
|
+
return null;
|
|
4267
|
+
}, (r) => {
|
|
4268
|
+
WritableStreamDefaultControllerErrorIfNeeded(writable._writableStreamController, r);
|
|
4269
|
+
TransformStreamUnblockWrite(stream);
|
|
4270
|
+
defaultControllerFinishPromiseReject(controller, r);
|
|
4271
|
+
return null;
|
|
4272
|
+
});
|
|
4273
|
+
return controller._finishPromise;
|
|
4274
|
+
}
|
|
3826
4275
|
function defaultControllerBrandCheckException(name) {
|
|
3827
4276
|
return new TypeError(`TransformStreamDefaultController.prototype.${name} can only be used on a TransformStreamDefaultController`);
|
|
3828
4277
|
}
|
|
4278
|
+
function defaultControllerFinishPromiseResolve(controller) {
|
|
4279
|
+
if (controller._finishPromise_resolve === void 0) {
|
|
4280
|
+
return;
|
|
4281
|
+
}
|
|
4282
|
+
controller._finishPromise_resolve();
|
|
4283
|
+
controller._finishPromise_resolve = void 0;
|
|
4284
|
+
controller._finishPromise_reject = void 0;
|
|
4285
|
+
}
|
|
4286
|
+
function defaultControllerFinishPromiseReject(controller, reason) {
|
|
4287
|
+
if (controller._finishPromise_reject === void 0) {
|
|
4288
|
+
return;
|
|
4289
|
+
}
|
|
4290
|
+
setPromiseIsHandledToTrue(controller._finishPromise);
|
|
4291
|
+
controller._finishPromise_reject(reason);
|
|
4292
|
+
controller._finishPromise_resolve = void 0;
|
|
4293
|
+
controller._finishPromise_reject = void 0;
|
|
4294
|
+
}
|
|
3829
4295
|
function streamBrandCheckException(name) {
|
|
3830
4296
|
return new TypeError(`TransformStream.prototype.${name} can only be used on a TransformStream`);
|
|
3831
4297
|
}
|
|
@@ -3842,7 +4308,6 @@ var require_ponyfill_es2018 = (0, import_chunk_2ESYSVXG.__commonJS)({
|
|
|
3842
4308
|
exports2.WritableStream = WritableStream;
|
|
3843
4309
|
exports2.WritableStreamDefaultController = WritableStreamDefaultController;
|
|
3844
4310
|
exports2.WritableStreamDefaultWriter = WritableStreamDefaultWriter;
|
|
3845
|
-
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
3846
4311
|
});
|
|
3847
4312
|
}
|
|
3848
4313
|
});
|
|
@@ -4553,6 +5018,15 @@ async function toFormData(Body, ct) {
|
|
|
4553
5018
|
node-domexception/index.js:
|
|
4554
5019
|
(*! node-domexception. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
4555
5020
|
|
|
5021
|
+
web-streams-polyfill/dist/ponyfill.es2018.js:
|
|
5022
|
+
(**
|
|
5023
|
+
* @license
|
|
5024
|
+
* web-streams-polyfill v3.3.3
|
|
5025
|
+
* Copyright 2024 Mattias Buelens, Diwank Singh Tomer and other contributors.
|
|
5026
|
+
* This code is released under the MIT license.
|
|
5027
|
+
* SPDX-License-Identifier: MIT
|
|
5028
|
+
*)
|
|
5029
|
+
|
|
4556
5030
|
fetch-blob/index.js:
|
|
4557
5031
|
(*! fetch-blob. MIT License. Jimmy Wärting <https://jimmy.warting.se/opensource> *)
|
|
4558
5032
|
|