Skip to content

Commit

Permalink
Fixup the exports in node:stream/web (#1873)
Browse files Browse the repository at this point in the history
  • Loading branch information
jasnell authored Mar 21, 2024
1 parent 371a876 commit 4e768b5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
37 changes: 18 additions & 19 deletions src/node/stream/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,24 @@
// https://opensource.org/licenses/Apache-2.0
//
/* eslint-disable */
export {
ReadableStream,
ReadableStreamDefaultReader,
ReadableStreamBYOBReader,
ReadableStreamBYOBRequest,
ReadableByteStreamController,
ReadableStreamDefaultController,
TransformStream,
TransformStreamDefaultController,
WritableStream,
WritableStreamDefaultWriter,
WritableStreamDefaultController,
ByteLengthQueuingStrategy,
CountQueuingStrategy,
TextEncoderStream,
TextDecoderStream,
CompressionStream,
DecompressionStream,
}

export const ReadableStream = globalThis.ReadableStream;
export const ReadableStreamDefaultReader = globalThis.ReadableStreamDefaultReader;
export const ReadableStreamBYOBReader = globalThis.ReadableStreamBYOBReader;
export const ReadableStreamBYOBRequest = globalThis.ReadableStreamBYOBRequest;
export const ReadableByteStreamController = globalThis.ReadableByteStreamController;
export const ReadableStreamDefaultController = globalThis.ReadableStreamDefaultController;
export const TransformStream = globalThis.TransformStream;
export const TransformStreamDefaultController = globalThis.TransformStreamDefaultController;
export const WritableStream = globalThis.WritableStream;
export const WritableStreamDefaultWriter = globalThis.WritableStreamDefaultWriter;
export const WritableStreamDefaultController = globalThis.WritableStreamDefaultController;
export const ByteLengthQueuingStrategy = globalThis.ByteLengthQueuingStrategy;
export const CountQueuingStrategy = globalThis.CountQueuingStrategy;
export const TextEncoderStream = globalThis.TextEncoderStream;
export const TextDecoderStream = globalThis.TextDecoderStream;
export const CompressionStream = globalThis.CompressionStream;
export const DecompressionStream = globalThis.DecompressionStream;

export default {
ReadableStream,
Expand Down
5 changes: 5 additions & 0 deletions src/workerd/api/node/streams-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import {
promises,
} from 'node:stream';

import {
ByteLengthQueuingStrategy,
} from 'node:stream/web';
strictEqual(ByteLengthQueuingStrategy, globalThis.ByteLengthQueuingStrategy);

import {
EventEmitter,
} from 'node:events';
Expand Down

0 comments on commit 4e768b5

Please sign in to comment.