Skip to content

Commit

Permalink
Added fix for cases when _bytesTransferred === 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinfarrugia committed Jun 21, 2021
1 parent 5e61bac commit 16cc629
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions lib/hara.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const parseLargestCompressed = (data) => {

return {
url: normalizeUrl(item.request.url),
bytesTransferred: item.response._transferSize || item._bytesIn,
bytesTransferred: item.response._transferSize || item._bytesIn || 0,
};
};

Expand Down Expand Up @@ -126,7 +126,7 @@ const parseRequests = (data) => {
),
},
bytesTransferred: sum(
data.map((n) => n.response._transferSize || n._bytesIn)
data.map((n) => n.response._transferSize || n._bytesIn || 0)
),
topUrl: parseTop(data.map((n) => normalizeUrl(n.request.url))),
largest: parseLargest(data),
Expand Down
3 changes: 0 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
"git add --force"
]
},
"scripts": {
"start": "node ./lib/main.js"
},
"license": "MIT",
"dependencies": {
"chalk": "^4.1.1",
Expand Down

0 comments on commit 16cc629

Please sign in to comment.