feat: Migrate JavaScript to TypeScript
This commit is contained in:
parent
b3cddbe7fa
commit
7b1d8d3b9b
17 changed files with 585 additions and 142 deletions
|
|
@ -1,14 +1,18 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
function getOS(platform) {
|
||||
if (platform === "linux") {
|
||||
return "Linux";
|
||||
} else if (platform === "darwin") {
|
||||
return "macOS";
|
||||
} else if (platform === "win32") {
|
||||
return "Windows";
|
||||
// throw new Error("Windows is not supported");
|
||||
} else {
|
||||
throw new Error(`${platform} is not supported`);
|
||||
}
|
||||
if (platform === "linux") {
|
||||
return "Linux";
|
||||
}
|
||||
else if (platform === "darwin") {
|
||||
return "macOS";
|
||||
}
|
||||
else if (platform === "win32") {
|
||||
return "Windows";
|
||||
// throw new Error("Windows is not supported");
|
||||
}
|
||||
else {
|
||||
throw new Error(`${platform} is not supported`);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = getOS;
|
||||
exports.default = getOS;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue