Change PLATFORM to constant instead of function
parent
eb0b7f8852
commit
80a318b8b8
@ -1,7 +1,6 @@
|
|||||||
export const IS_WINDOWS = process.platform === 'win32';
|
export const IS_WINDOWS = process.platform === 'win32';
|
||||||
export const IS_LINUX = process.platform === 'linux';
|
export const PLATFORM = ((): 'windows' | 'linux' | 'mac' => {
|
||||||
export const getPlatform = (): 'windows' | 'linux' | 'mac' => {
|
if (process.platform === 'win32') return 'windows';
|
||||||
if (IS_WINDOWS) return 'windows';
|
if (process.platform === 'linux') return 'linux';
|
||||||
if (IS_LINUX) return 'linux';
|
|
||||||
return 'mac';
|
return 'mac';
|
||||||
};
|
})();
|
||||||
|
|||||||
Loading…
Reference in New Issue