Skip to content

Commit

Permalink
update condition to switch
Browse files Browse the repository at this point in the history
  • Loading branch information
wobsoriano committed Sep 11, 2023
1 parent ce3ba13 commit b51ba34
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ import getWin32WifiName from './os/win32'
const OS = process.platform

export function getWifiName() {
if (OS === "darwin") {
return getDarwinWifiName()
} else if (OS === 'win32') {
return getWin32WifiName()
} else if (OS === "linux") {
return getLinuxWifiName()
switch (OS) {
case 'darwin':
return getDarwinWifiName()
case 'win32':
return getWin32WifiName()
case 'linux':
return getLinuxWifiName()
default:
throw new Error("Not supported")
}

throw new Error("Not supported")
}

export default getWifiName

0 comments on commit b51ba34

Please sign in to comment.