File tree Expand file tree Collapse file tree 3 files changed +21
-1
lines changed
eventstream-serde-browser/src Expand file tree Collapse file tree 3 files changed +21
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @smithy/eventstream-serde-browser " : patch
3+ " @smithy/util-stream " : patch
4+ ---
5+
6+ avoid compilation of global ReadableStream with type parameter
Original file line number Diff line number Diff line change @@ -68,5 +68,11 @@ export class EventStreamMarshaller {
6868 }
6969}
7070
71+ /**
72+ * @internal
73+ * Warning: do not export this without aliasing the reference to
74+ * global ReadableStream.
75+ * @see https://github.com/smithy-lang/smithy-typescript/issues/1341.
76+ */
7177const isReadableStream = ( body : any ) : body is ReadableStream =>
7278 typeof ReadableStream === "function" && body instanceof ReadableStream ;
Original file line number Diff line number Diff line change 11/**
22 * @internal
3+ * Alias prevents compiler from turning
4+ * ReadableStream into ReadableStream<any>, which is incompatible
5+ * with the NodeJS.ReadableStream global type.
36 */
4- export const isReadableStream = ( stream : unknown ) : stream is ReadableStream =>
7+ type ReadableStreamType = ReadableStream ;
8+
9+ /**
10+ * @internal
11+ */
12+ export const isReadableStream = ( stream : unknown ) : stream is ReadableStreamType =>
513 typeof ReadableStream === "function" &&
614 ( stream ?. constructor ?. name === ReadableStream . name || stream instanceof ReadableStream ) ;
You can’t perform that action at this time.
0 commit comments