MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / expose

Function expose

packages/cli/src/utils/machine-id-utils.ts:33–60  ·  view source on GitHub ↗
(result: string)

Source from the content-addressed store, hash-verified

31}
32
33function expose(result: string): string | undefined {
34 switch (platform) {
35 case 'darwin':
36 return result
37 .split('IOPlatformUUID')[1]
38 ?.split('\n')[0]
39 ?.replace(/=|\s+|"/gi, '')
40 .toLowerCase();
41 case 'win32':
42 return result
43 .toString()
44 .split('REG_SZ')[1]
45 ?.replace(/\r+|\n+|\s+/gi, '')
46 .toLowerCase();
47 case 'linux':
48 return result
49 .toString()
50 .replace(/\r+|\n+|\s+/gi, '')
51 .toLowerCase();
52 case 'freebsd':
53 return result
54 .toString()
55 .replace(/\r+|\n+|\s+/gi, '')
56 .toLowerCase();
57 default:
58 throw new Error(`Unsupported platform: ${process.platform}`);
59 }
60}
61
62export function getMachineId() {
63 if (!(platform in guid)) {

Callers 1

getMachineIdFunction · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected