Skip to content

Commit c5136dd

Browse files
authored
Fix missing properties in JSON output (#89)
1 parent 81542e4 commit c5136dd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ fast --upload --json
5252
{
5353
"downloadSpeed": 52,
5454
"uploadSpeed": 64,
55+
"downloadUnit": "Mbps",
56+
"uploadUnit": "Mbps",
5557
"downloaded": 270,
5658
"uploaded": 290,
5759
"latency": 9,

source/ui.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ const Ui: React.FC<FastProperties> = ({singleLine, upload, json}) => {
162162
...data,
163163
downloadSpeed: convertToMbps(data.downloadSpeed!, data.downloadUnit!),
164164
uploadSpeed: upload ? convertToMbps(data.uploadSpeed!, data.uploadUnit!) : undefined,
165-
downloadUnit: undefined,
166-
uploadUnit: upload ? undefined : data.uploadUnit,
165+
downloadUnit: data.downloadUnit,
166+
uploadUnit: upload ? data.uploadUnit : undefined,
167167
isDone: undefined, // Explicitly omit 'isDone'
168168
};
169169

0 commit comments

Comments
 (0)