Skip to content

Commit

Permalink
fix(api): capitalize first letter in network type
Browse files Browse the repository at this point in the history
  • Loading branch information
MauriceNino committed Feb 1, 2023
1 parent 8302df4 commit ad934e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/api/src/data/network.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetworkInfo, NetworkLoad, removePad } from '@dash/common';
import { capFirst, NetworkInfo, NetworkLoad, removePad } from '@dash/common';
import { exec as cexec } from 'child_process';
import * as fs from 'fs';
import * as si from 'systeminformation';
Expand Down Expand Up @@ -89,7 +89,7 @@ export default {
const defaultNet = networkInfo.find(net => net.default)!;

return {
type: defaultNet.type,
type: capFirst(defaultNet.type),
interfaceSpeed: defaultNet.speed,
};
}
Expand Down
4 changes: 4 additions & 0 deletions libs/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ export const removePad = (strings: TemplateStringsArray, ...content: any[]) => {

return trimmed.map(s => s.substring(shortestPad)).join('\n');
};

export const capFirst = (str: string) => {
return str[0].toUpperCase() + str.slice(1);
};

0 comments on commit ad934e7

Please sign in to comment.