1const isPlatform = name => { 2 let handle 3 4 switch (name) { 5 case 'windows': 6 handle = 'win32' 7 break 8 case 'macOS': 9 handle = 'darwin' 10 break 11 default: 12 handle = name 13 } 14 15 return process.platform === handle 16} 17 18module.exports = isPlatform 19 20