Skip to content

Commit

Permalink
Remove unnecessary code for compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljbruce committed Jun 10, 2024
1 parent 0491b58 commit 10c1a63
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions src/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,31 +758,14 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`);
to allow the user to cancel the stream and instantly stop receiving more
data in the stream.
*/
userStream.end = (
chunkOrCb: () => void | Row,
encodingOrCb?: BufferEncoding | (() => void),
cb?: () => void
) => {
userStream.end = (chunkOrCb: () => void | Row) => {
rowStreamUnpipe(rowStream, userStream);
userCanceled = true;
if (activeRequestStream) {
activeRequestStream.abort();
}
originalEnd();
function isEncoding(
e: BufferEncoding | (() => void)
): e is BufferEncoding {
return true;
}
if (encodingOrCb) {
if (encodingOrCb && isEncoding(encodingOrCb)) {
return originalEnd(chunkOrCb, encodingOrCb, cb);
} else {
return originalEnd(chunkOrCb, encodingOrCb);
}
} else {
return originalEnd(chunkOrCb); // In practice, this code path is used.
}
return originalEnd(chunkOrCb); // In practice, this code path is used.
};
// The chunk transformer is used for transforming raw readrows data from
// the server into data that can be consumed by the user.
Expand Down

0 comments on commit 10c1a63

Please sign in to comment.