Skip to content

Commit

Permalink
add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrinizzard committed Apr 28, 2024
1 parent b9c9260 commit 532dd77
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/quicktype-core/src/input/io/NodeIO.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export async function readableFromFileOrURL(fileOrURL: string, httpHeaders?: str
const maybeWebReadable = defined(response.body)!;

if (!maybeWebReadable.once) {
// if the `once` function does not exist, this is likely a web [ReadableStream](https://developer.mozilla.org/docs/Web/API/ReadableStream) instead of a node one
return NodeReadable.fromWeb(maybeWebReadable) as Readable;
}
return maybeWebReadable as Readable;
Expand Down

0 comments on commit 532dd77

Please sign in to comment.