MCPcopy Index your code
hub / github.com/sindresorhus/fast-cli / formatTextOutput

Function formatTextOutput

source/ui.tsx:211–226  ·  view source on GitHub ↗
(data: PartialSpeedData, upload: boolean, verbose: boolean)

Source from the content-addressed store, hash-verified

209}
210
211function 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
228type FastProperties = {
229 readonly singleLine?: boolean;

Callers 1

UiFunction · 0.85

Calls 1

formatVerboseTextFunction · 0.85

Tested by

no test coverage detected