It builds

This commit is contained in:
Gabe Kangas
2020-11-01 00:01:37 -07:00
parent 27f4b8b158
commit 9b89955bb7
17 changed files with 107 additions and 84 deletions

19
web/utils/format.ts Normal file
View File

@@ -0,0 +1,19 @@
export function formatIPAddress(ipAddress: string): string {
const ipAddressComponents = ipAddress.split(':')
// Wipe out the port component
ipAddressComponents[ipAddressComponents.length - 1] = '';
let ip = ipAddressComponents.join(':')
ip = ip.slice(0, ip.length - 1)
if (ip === '[::1]' || ip === '127.0.0.1') {
return "Localhost"
}
return ip;
}
// check if obj is {}
export function isEmptyObject(obj) {
return !obj || Object.keys(obj).length === 0;
}