MCPcopy Create free account
hub / github.com/csskit/csskit / platformInfo

Function platformInfo

packages/csskit_vscode/src/main.js:48–80  ·  view source on GitHub ↗

* @returns {{ platform: string, arch: string, exe: string }}

()

Source from the content-addressed store, hash-verified

46 * @returns {{ platform: string, arch: string, exe: string }}
47 */
48function platformInfo() {
49 /** @type {string} */
50 let platform;
51 switch (process.platform) {
52 case "darwin":
53 platform = "darwin";
54 break;
55 case "linux":
56 platform = "linux";
57 break;
58 case "win32":
59 platform = "win32";
60 break;
61 default:
62 throw new Error(`Unsupported platform: ${process.platform}`);
63 }
64
65 /** @type {string} */
66 let arch;
67 switch (process.arch) {
68 case "arm64":
69 arch = "arm64";
70 break;
71 case "x64":
72 arch = "x64";
73 break;
74 default:
75 throw new Error(`Unsupported architecture: ${process.arch}`);
76 }
77
78 const exe = process.platform === "win32" ? ".exe" : "";
79 return { platform, arch, exe };
80}
81
82/**
83 * @param {string} storageDir

Callers 1

ensureBinaryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected