@zimic/interceptor 1.1.1 → 1.1.2-canary.0
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/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/cli.mjs.map +1 -1
- package/dist/http.js +27 -19
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +27 -19
- package/dist/http.mjs.map +1 -1
- package/package.json +4 -4
- package/src/http/interceptor/HttpInterceptorClient.ts +3 -3
package/dist/http.mjs
CHANGED
|
@@ -423,7 +423,7 @@ var TimesCheckError = class extends TypeError {
|
|
|
423
423
|
};
|
|
424
424
|
var TimesCheckError_default = TimesCheckError;
|
|
425
425
|
|
|
426
|
-
// ../zimic-utils/dist/chunk-
|
|
426
|
+
// ../zimic-utils/dist/chunk-F2EXWCVL.mjs
|
|
427
427
|
async function blobEquals(blob, otherBlob) {
|
|
428
428
|
if (blob.type !== otherBlob.type || blob.size !== otherBlob.size) {
|
|
429
429
|
return false;
|
|
@@ -434,24 +434,32 @@ async function blobEquals(blob, otherBlob) {
|
|
|
434
434
|
let otherBuffer = new Uint8Array(0);
|
|
435
435
|
try {
|
|
436
436
|
while (true) {
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
437
|
+
const bufferReadPromises = [];
|
|
438
|
+
if (buffer.length === 0) {
|
|
439
|
+
bufferReadPromises.push(
|
|
440
|
+
reader.read().then((result) => {
|
|
441
|
+
if (!result.done) {
|
|
442
|
+
buffer = result.value;
|
|
443
|
+
}
|
|
444
|
+
})
|
|
445
|
+
);
|
|
446
|
+
}
|
|
447
|
+
if (otherBuffer.length === 0) {
|
|
448
|
+
bufferReadPromises.push(
|
|
449
|
+
otherReader.read().then((result) => {
|
|
450
|
+
if (!result.done) {
|
|
451
|
+
otherBuffer = result.value;
|
|
452
|
+
}
|
|
453
|
+
})
|
|
454
|
+
);
|
|
455
|
+
}
|
|
456
|
+
await Promise.all(bufferReadPromises);
|
|
457
|
+
const haveStreamsEndedTogether = buffer.length === 0 && otherBuffer.length === 0;
|
|
458
|
+
if (haveStreamsEndedTogether) {
|
|
451
459
|
return true;
|
|
452
460
|
}
|
|
453
|
-
const
|
|
454
|
-
if (
|
|
461
|
+
const hasOneStreamEndedBeforeTheOther = buffer.length === 0 && otherBuffer.length > 0 || buffer.length > 0 && otherBuffer.length === 0;
|
|
462
|
+
if (hasOneStreamEndedBeforeTheOther) {
|
|
455
463
|
return false;
|
|
456
464
|
}
|
|
457
465
|
const minimumByteLength = Math.min(buffer.length, otherBuffer.length);
|
|
@@ -1740,12 +1748,12 @@ var HttpInterceptorClient = class {
|
|
|
1740
1748
|
}
|
|
1741
1749
|
clear(options = {}) {
|
|
1742
1750
|
const clearResults = [
|
|
1743
|
-
this.workerOrThrow.clearInterceptorHandlers(this)
|
|
1751
|
+
Promise.resolve(this.workerOrThrow.clearInterceptorHandlers(this))
|
|
1744
1752
|
];
|
|
1745
1753
|
for (const method of HTTP_METHODS) {
|
|
1746
1754
|
const newClearResults = this.clearMethodHandlers(method);
|
|
1747
1755
|
for (const result of newClearResults) {
|
|
1748
|
-
clearResults.push(result);
|
|
1756
|
+
clearResults.push(Promise.resolve(result));
|
|
1749
1757
|
}
|
|
1750
1758
|
const handlersByPath = this.handlerClientsByMethod[method];
|
|
1751
1759
|
handlersByPath.clear();
|