session-desktop/ts/OS.ts
2022-01-18 15:21:36 +11:00

15 lines
424 B
TypeScript

import _ from 'lodash';
import os from 'os';
import semver from 'semver';
export const isMacOS = () => process.platform === 'darwin';
export const isLinux = () => process.platform === 'linux';
export const isWindows = (minVersion?: string) => {
const osRelease = os.release();
if (process.platform !== 'win32') {
return false;
}
return _.isUndefined(minVersion) ? true : semver.gte(osRelease, minVersion);
};