You cannot select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
	
	
		
			16 lines
		
	
	
		
			497 B
		
	
	
	
		
			TypeScript
		
	
		
		
			
		
	
	
			16 lines
		
	
	
		
			497 B
		
	
	
	
		
			TypeScript
		
	
| 
								 
											8 years ago
										 
									 | 
							
								import is from '@sindresorhus/is';
							 | 
						||
| 
								 | 
							
								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 isPlatformValid = process.platform === 'win32';
							 | 
						||
| 
								 | 
							
								  const osRelease = os.release();
							 | 
						||
| 
								 | 
							
								  const isVersionValid = is.undefined(minVersion)
							 | 
						||
| 
								 | 
							
								    ? true
							 | 
						||
| 
								 | 
							
								    : semver.gte(osRelease, minVersion);
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return isPlatformValid && isVersionValid;
							 | 
						||
| 
								 | 
							
								};
							 |