diff --git a/package-lock.json b/package-lock.json index f873c15..cc6dd7a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,7 +29,7 @@ "ts-node": "^10.9.2", "tsx": "^4.7.0", "typescript": "^5.5.2", - "web-streams-polyfill": "^3.3.2" + "web-streams-polyfill": "^4.0.0" }, "engines": { "node": ">= 16.5.0" @@ -6224,9 +6224,9 @@ } }, "node_modules/web-streams-polyfill": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz", - "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0.tgz", + "integrity": "sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==", "dev": true, "engines": { "node": ">= 8" @@ -11004,9 +11004,9 @@ } }, "web-streams-polyfill": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.2.tgz", - "integrity": "sha512-3pRGuxRF5gpuZc0W+EpwQRmCD7gRqcDOMt688KmdlDAgAyaB1XlN0zq2njfDNm44XVdIouE7pZ6GzbdyH47uIQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-4.0.0.tgz", + "integrity": "sha512-0zJXHRAYEjM2tUfZ2DiSOHAa2aw1tisnnhU3ufD57R8iefL+DcdJyRBRyJpG+NUimDgbTI/lH+gAE1PAvV3Cgw==", "dev": true }, "webpack": { diff --git a/package.json b/package.json index ece4265..32d2459 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "ts-node": "^10.9.2", "tsx": "^4.7.0", "typescript": "^5.5.2", - "web-streams-polyfill": "^3.3.2" + "web-streams-polyfill": "^4.0.0" }, "peerDependencies": { "typescript": ">=4.2" diff --git a/test/node.test.ts b/test/node.test.ts index a624736..abb19ea 100644 --- a/test/node.test.ts +++ b/test/node.test.ts @@ -37,16 +37,16 @@ describe('Node integration tests', () => { it('polyfilled web stream cannot be converted into node native stream', async () => { const { ReadableStream: PolyfilledReadableStream } = await import ('web-streams-polyfill'); - // this test is just to keep track that this behaviour is expected + // this test is just to keep track that this behaviour is expected: it does not cause a TS error, but a runtime one const input = 'chunk'; - const stream = new PolyfilledReadableStream({ + const stream: NodeWebReadableStream = new PolyfilledReadableStream({ start(controller) { controller.enqueue(input); controller.close(); } }); const streamedData = toStream(stream); - // @ts-expect-error `fromWeb` does not accept the polyfilled stream + // `fromWeb` does not accept the polyfilled stream expect(() => NodeNativeReadableStream.fromWeb(streamedData)).to.throw(/must be an instance of ReadableStream/); }); });