From be83eb711da766b86e29404e61743906a6c3829c Mon Sep 17 00:00:00 2001 From: jeremigendron Date: Wed, 19 Dec 2018 20:39:56 -0500 Subject: [PATCH 1/2] replace ~~ with Math.trunc --- lib/response.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index 371875fe1..46bfce3c3 100644 --- a/lib/response.js +++ b/lib/response.js @@ -211,7 +211,7 @@ module.exports = { return; } - return ~~len; + return Math.trunc(len); }, /** From f5d3640a41af8aeef8d627d4b7e6d64fadf1cf17 Mon Sep 17 00:00:00 2001 From: jeremiG Date: Thu, 20 Dec 2018 10:05:11 -0500 Subject: [PATCH 2/2] || 0 to avoid NaN --- lib/response.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index 46bfce3c3..b7d77dea8 100644 --- a/lib/response.js +++ b/lib/response.js @@ -211,7 +211,7 @@ module.exports = { return; } - return Math.trunc(len); + return Math.trunc(len) || 0; }, /**