-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c716329
commit 41930d4
Showing
10 changed files
with
76 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
* text=auto | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
node_modules | ||
yarn.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: | ||
- '10' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
The MIT License (MIT) | ||
MIT License | ||
|
||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,42 @@ | ||
{ | ||
"name": "os-name", | ||
"version": "2.0.1", | ||
"description": "Get the name of the current operating system. Example: macOS Sierra", | ||
"license": "MIT", | ||
"repository": "sindresorhus/os-name", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"os", | ||
"operating", | ||
"system", | ||
"platform", | ||
"name", | ||
"title", | ||
"release", | ||
"version", | ||
"macos", | ||
"osx", | ||
"windows", | ||
"linux" | ||
], | ||
"dependencies": { | ||
"macos-release": "^2.0.0", | ||
"windows-release": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "os-name", | ||
"version": "2.0.1", | ||
"description": "Get the name of the current operating system. Example: macOS Sierra", | ||
"license": "MIT", | ||
"repository": "sindresorhus/os-name", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=6" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"os", | ||
"operating", | ||
"system", | ||
"platform", | ||
"name", | ||
"title", | ||
"release", | ||
"version", | ||
"macos", | ||
"windows", | ||
"linux" | ||
], | ||
"dependencies": { | ||
"macos-release": "^2.0.0", | ||
"windows-release": "^3.1.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.25.0", | ||
"xo": "^0.23.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import os from 'os'; | ||
import test from 'ava'; | ||
import m from '.'; | ||
import osName from '.'; | ||
|
||
test(t => { | ||
t.true(m().length > 0); | ||
t.is(m('darwin', '18.0.0'), 'macOS Mojave'); | ||
t.is(m('darwin', '17.0.0'), 'macOS High Sierra'); | ||
t.is(m('darwin', '16.0.0'), 'macOS Sierra'); | ||
t.is(m('darwin', '14.0.0'), 'OS X Yosemite'); | ||
t.is(m('darwin', '99.0.0'), 'macOS'); | ||
t.is(m('linux', '3.13.0-24-generic'), 'Linux 3.13'); | ||
t.is(m('win32', '5.1.2600'), 'Windows XP'); | ||
t.is(m('win32', '4.90'), 'Windows ME'); | ||
t.is(m('win32', '6.2'), 'Windows 8'); | ||
t.is(m('win32', '10.0'), 'Windows 10'); | ||
test('main', t => { | ||
t.true(osName().length > 0); | ||
t.is(osName('darwin', '18.0.0'), 'macOS Mojave'); | ||
t.is(osName('darwin', '17.0.0'), 'macOS High Sierra'); | ||
t.is(osName('darwin', '16.0.0'), 'macOS Sierra'); | ||
t.is(osName('darwin', '14.0.0'), 'OS X Yosemite'); | ||
t.is(osName('darwin', '99.0.0'), 'macOS'); | ||
t.is(osName('linux', '3.13.0-24-generic'), 'Linux 3.13'); | ||
t.is(osName('win32', '5.1.2600'), 'Windows XP'); | ||
t.is(osName('win32', '4.90'), 'Windows ME'); | ||
t.is(osName('win32', '6.2'), 'Windows 8'); | ||
t.is(osName('win32', '10.0'), 'Windows 10'); | ||
|
||
os.platform = () => 'darwin'; | ||
t.is(m('win32'), 'Windows'); | ||
t.is(m('linux'), 'Linux'); | ||
t.is(osName('win32'), 'Windows'); | ||
t.is(osName('linux'), 'Linux'); | ||
|
||
os.platform = () => 'linux'; | ||
t.is(m('darwin'), 'macOS'); | ||
t.is(m('win32'), 'Windows'); | ||
t.is(osName('darwin'), 'macOS'); | ||
t.is(osName('win32'), 'Windows'); | ||
|
||
os.platform = () => 'win32'; | ||
t.is(m('darwin'), 'macOS'); | ||
t.is(m('linux'), 'Linux'); | ||
t.is(osName('darwin'), 'macOS'); | ||
t.is(osName('linux'), 'Linux'); | ||
}); |