From c17468fe13b07c610c90772bfdcec53e72812503 Mon Sep 17 00:00:00 2001 From: ehmicky Date: Sun, 27 Oct 2024 22:24:29 +0000 Subject: [PATCH] Upgrade dependencies --- .github/workflows/main.yml | 2 +- package.json | 2 +- source/index.d.ts | 2 +- source/index.test-d.ts | 1 - test/helpers/index.js | 1 - test/integration.js | 3 --- test/stream.js | 1 - test/web-stream-ponyfill.js | 4 ---- test/web-stream.js | 3 --- 9 files changed, 3 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c27cac..50a2379 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: fail-fast: false matrix: node-version: - - 22 + - 23 - 18 steps: - uses: actions/checkout@v4 diff --git a/package.json b/package.json index 8b0e8b1..aeb5e0c 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "concat" ], "dependencies": { - "@sec-ant/readable-stream": "^0.5.0", + "@sec-ant/readable-stream": "^0.6.0", "is-stream": "^4.0.1" }, "devDependencies": { diff --git a/source/index.d.ts b/source/index.d.ts index 724a45c..79cf4ca 100644 --- a/source/index.d.ts +++ b/source/index.d.ts @@ -8,7 +8,7 @@ export class MaxBufferError extends Error { // eslint-disable-next-line @typescript-eslint/ban-types type TextStreamItem = string | Buffer | ArrayBuffer | ArrayBufferView; -// eslint-disable-next-line n/no-unsupported-features/node-builtins + export type AnyStream = Readable | ReadableStream | AsyncIterable; export type Options = { diff --git a/source/index.test-d.ts b/source/index.test-d.ts index ddc7e69..8415448 100644 --- a/source/index.test-d.ts +++ b/source/index.test-d.ts @@ -80,7 +80,6 @@ expectError(await getStreamAsArrayBuffer(nodeStream, {maxBuffer: 10}, {})); expectType(await getStreamAsArray(nodeStream)); expectType(await getStreamAsArray(nodeStream, {maxBuffer: 10})); expectType(await getStreamAsArray(readableStream)); -// eslint-disable-next-line n/no-unsupported-features/node-builtins expectType(await getStreamAsArray(readableStream as ReadableStream)); expectType(await getStreamAsArray(stringAsyncIterable)); // eslint-disable-next-line @typescript-eslint/ban-types diff --git a/test/helpers/index.js b/test/helpers/index.js index 943c9e4..4fe4631 100644 --- a/test/helpers/index.js +++ b/test/helpers/index.js @@ -5,7 +5,6 @@ import {finished} from 'node:stream/promises'; export {fromAnyIterable as readableStreamFrom} from '@sec-ant/readable-stream/ponyfill'; export const createStream = streamDefinition => typeof streamDefinition === 'function' - // eslint-disable-next-line n/no-unsupported-features/node-builtins ? Duplex.from(streamDefinition) : Readable.from(streamDefinition); diff --git a/test/integration.js b/test/integration.js index 21ad021..5945114 100644 --- a/test/integration.js +++ b/test/integration.js @@ -9,7 +9,6 @@ import {fixtureString, fixtureBuffer, fixtureUtf16} from './fixtures/index.js'; const TEST_URL = 'https://nodejs.org/dist/index.json'; -// eslint-disable-next-line n/no-unsupported-features/node-builtins const createReadableStream = streamDefinition => Duplex.toWeb(Duplex.from(streamDefinition)).readable; test('works with opendir()', async t => { @@ -64,7 +63,6 @@ if (!nodeVersion.startsWith('v16.')) { test('works with readableWebStream({ type: "bytes" })', readableWebStream, 'bytes'); test('works with fetch()', async t => { - // eslint-disable-next-line n/no-unsupported-features/node-builtins const {body} = await fetch(TEST_URL); const result = await getStream(body); const parsedResult = JSON.parse(result); @@ -72,7 +70,6 @@ if (!nodeVersion.startsWith('v16.')) { }); test('can use TextDecoderStream', async t => { - // eslint-disable-next-line n/no-unsupported-features/node-builtins const textDecoderStream = new TextDecoderStream('utf-16le'); const result = await getStream( createReadableStream(fixtureUtf16).pipeThrough(textDecoderStream), diff --git a/test/stream.js b/test/stream.js index 89e4028..533d367 100644 --- a/test/stream.js +++ b/test/stream.js @@ -274,7 +274,6 @@ const testMultipleReads = async (t, wait) => { assertSuccess(t, stream, Readable); }; -// eslint-disable-next-line n/no-unsupported-features/node-builtins test('Handles multiple successive fast reads', testMultipleReads, () => scheduler.yield()); test('Handles multiple successive slow reads', testMultipleReads, () => pSetTimeout(100)); diff --git a/test/web-stream-ponyfill.js b/test/web-stream-ponyfill.js index 10dd78e..65209dc 100644 --- a/test/web-stream-ponyfill.js +++ b/test/web-stream-ponyfill.js @@ -1,17 +1,13 @@ import test from 'ava'; // Emulate browsers that do not support those methods -// eslint-disable-next-line n/no-unsupported-features/node-builtins delete ReadableStream.prototype.values; -// eslint-disable-next-line n/no-unsupported-features/node-builtins delete ReadableStream.prototype[Symbol.asyncIterator]; // Run those tests, but emulating browsers await import('./web-stream.js'); test('Should not polyfill ReadableStream', t => { - // eslint-disable-next-line n/no-unsupported-features/node-builtins t.is(ReadableStream.prototype.values, undefined); - // eslint-disable-next-line n/no-unsupported-features/node-builtins t.is(ReadableStream.prototype[Symbol.asyncIterator], undefined); }); diff --git a/test/web-stream.js b/test/web-stream.js index a768dcf..1e94c3d 100644 --- a/test/web-stream.js +++ b/test/web-stream.js @@ -18,7 +18,6 @@ test('Can use already ended ReadableStream', async t => { test('Can use already canceled ReadableStream', async t => { let canceledValue; - // eslint-disable-next-line n/no-unsupported-features/node-builtins const stream = new ReadableStream({ cancel(canceledError) { canceledValue = canceledError; @@ -33,7 +32,6 @@ test('Can use already canceled ReadableStream', async t => { test('Can use already errored ReadableStream', async t => { const error = new Error('test'); - // eslint-disable-next-line n/no-unsupported-features/node-builtins const stream = new ReadableStream({ start(controller) { controller.error(error); @@ -45,7 +43,6 @@ test('Can use already errored ReadableStream', async t => { test('Cancel ReadableStream when maxBuffer is hit', async t => { let canceled = false; - // eslint-disable-next-line n/no-unsupported-features/node-builtins const stream = new ReadableStream({ start(controller) { controller.enqueue(fixtureString);