Skip to content

Commit

Permalink
Fix Windows 11 check
Browse files Browse the repository at this point in the history
Fixes #15
  • Loading branch information
sindresorhus committed Nov 11, 2021
1 parent 09f90ba commit 1bfd8d3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export default function osName(platform, release) {

try {
id = release ? macosRelease(release).name : '';

if (id === 'Unknown') {
return prefix;
}
} catch {}

return prefix + (id ? ' ' + id : '');
Expand Down
2 changes: 1 addition & 1 deletion index.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {expectType} from 'tsd';
import osName from './index.js';

expectType<string>(osName());
expectType<string>(osName(os.platform(), os.release())); // eslint-disable-line @typescript-eslint/no-unsafe-member-access
expectType<string>(osName(os.platform(), os.release()));
expectType<string>(osName('darwin', '14.0.0'));
expectType<string>(osName('linux', '3.13.0-24-generic'));
expectType<string>(osName('win32', '6.3.9600'));
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
"linux"
],
"dependencies": {
"macos-release": "^3.0.0",
"windows-release": "^5.0.0"
"macos-release": "^3.0.1",
"windows-release": "^5.0.1"
},
"devDependencies": {
"@types/node": "^16.6.0",
"@types/node": "^16.11.7",
"ava": "^3.15.0",
"tsd": "^0.17.0",
"xo": "^0.44.0"
"tsd": "^0.18.0",
"xo": "^0.46.4"
}
}
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Useful for analytics and debugging.

## Install

```
$ npm install os-name
```sh
npm install os-name
```

## Usage
Expand Down

0 comments on commit 1bfd8d3

Please sign in to comment.