refactor: rewrite on typescript
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
import os from "os";
|
||||
|
||||
export class System {
|
||||
static get isWindows() {
|
||||
return os.type() === "Windows_NT";
|
||||
}
|
||||
|
||||
static get isLinux() {
|
||||
return os.type() === "Linux";
|
||||
}
|
||||
|
||||
static get os() {
|
||||
return this.isWindows ? "windows" : this.isLinux ? "linux" : undefined;
|
||||
}
|
||||
|
||||
static get archInt() {
|
||||
if (os.arch() === "ia32") return 32;
|
||||
if (os.arch() === "x64") return 64;
|
||||
}
|
||||
|
||||
static get isArch32() {
|
||||
return this.archInt === 32;
|
||||
}
|
||||
|
||||
static get isArch64() {
|
||||
return this.archInt === 64;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user