mirror of
https://github.com/tale/headplane.git
synced 2026-08-29 00:17:13 +00:00
chore: format everything with oxfmt
This commit is contained in:
+25
-25
@@ -1,36 +1,36 @@
|
||||
import type { HostInfo } from '~/types';
|
||||
import type { HostInfo } from "~/types";
|
||||
|
||||
export function getTSVersion(host: HostInfo) {
|
||||
const { IPNVersion } = host;
|
||||
if (!IPNVersion) {
|
||||
return 'Unknown';
|
||||
}
|
||||
const { IPNVersion } = host;
|
||||
if (!IPNVersion) {
|
||||
return "Unknown";
|
||||
}
|
||||
|
||||
// IPNVersion is <Semver>-<something>-<something>
|
||||
return IPNVersion.split('-')[0];
|
||||
// IPNVersion is <Semver>-<something>-<something>
|
||||
return IPNVersion.split("-")[0];
|
||||
}
|
||||
|
||||
export function getOSInfo(host: HostInfo) {
|
||||
const { OS, OSVersion } = host;
|
||||
// OS follows runtime.GOOS but uses iOS and macOS instead of darwin
|
||||
const formattedOS = formatOS(OS);
|
||||
const { OS, OSVersion } = host;
|
||||
// OS follows runtime.GOOS but uses iOS and macOS instead of darwin
|
||||
const formattedOS = formatOS(OS);
|
||||
|
||||
// Trim in case OSVersion is empty
|
||||
return `${formattedOS} ${OSVersion ?? ''}`.trim();
|
||||
// Trim in case OSVersion is empty
|
||||
return `${formattedOS} ${OSVersion ?? ""}`.trim();
|
||||
}
|
||||
|
||||
function formatOS(os?: string) {
|
||||
switch (os) {
|
||||
case 'macOS':
|
||||
case 'iOS':
|
||||
return os;
|
||||
case 'windows':
|
||||
return 'Windows';
|
||||
case 'linux':
|
||||
return 'Linux';
|
||||
case undefined:
|
||||
return 'Unknown';
|
||||
default:
|
||||
return os;
|
||||
}
|
||||
switch (os) {
|
||||
case "macOS":
|
||||
case "iOS":
|
||||
return os;
|
||||
case "windows":
|
||||
return "Windows";
|
||||
case "linux":
|
||||
return "Linux";
|
||||
case undefined:
|
||||
return "Unknown";
|
||||
default:
|
||||
return os;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user