Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
prevent deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Aug 25, 2018
1 parent d5bf206 commit 3d39836
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function get_server_route_handler(routes: ServerRoute[]) {

// intercept data so that it can be exported
res.write = function(chunk: any) {
chunks.push(new Buffer(chunk));
chunks.push(Buffer.from(chunk));
write.apply(res, arguments);
};

Expand All @@ -227,7 +227,7 @@ function get_server_route_handler(routes: ServerRoute[]) {
};

res.end = function(chunk?: any) {
if (chunk) chunks.push(new Buffer(chunk));
if (chunk) chunks.push(Buffer.from(chunk));
end.apply(res, arguments);

process.send({
Expand Down

0 comments on commit 3d39836

Please sign in to comment.