(data: PartialSpeedData, upload: boolean, verbose: boolean)
| 209 | } |
| 210 | |
| 211 | function formatTextOutput(data: PartialSpeedData, upload: boolean, verbose: boolean): string { |
| 212 | let output = `${data.downloadSpeed ?? 0} ${data.downloadUnit ?? 'Mbps'}`; |
| 213 | |
| 214 | if (upload && data.uploadSpeed) { |
| 215 | output += `\n${data.uploadSpeed} ${data.uploadUnit ?? 'Mbps'}`; |
| 216 | } |
| 217 | |
| 218 | if (verbose) { |
| 219 | const verboseLines = formatVerboseText(data); |
| 220 | if (verboseLines.length > 0) { |
| 221 | output += '\n\n' + verboseLines.join('\n'); |
| 222 | } |
| 223 | } |
| 224 | |
| 225 | return output; |
| 226 | } |
| 227 | |
| 228 | type FastProperties = { |
| 229 | readonly singleLine?: boolean; |
no test coverage detected