refactor(desktop): organize lib modules by domain
This commit is contained in:
1 parent
90f0594e93
commit
7e7c4944e9
700 files changed
+1292
-1264
No files matched your search
@@ -0,0 +1,17 @@
|
||||
export type Platform = "macos" | "windows" | "linux" | "unknown";
|
||||
|
||||
export function getPlatform(): Platform {
|
||||
const ua = navigator.userAgent.toLowerCase();
|
||||
if (ua.includes("mac")) return "macos";
|
||||
if (ua.includes("win")) return "windows";
|
||||
if (ua.includes("linux")) return "linux";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
export function isMacOS(): boolean {
|
||||
return getPlatform() === "macos";
|
||||
}
|
||||
|
||||
export function isWindows(): boolean {
|
||||
return getPlatform() === "windows";
|
||||
}
|
||||
Reference in new issue
Block a user