macos-version
Advanced tools
Comparing version 4.0.1 to 4.1.0
24
index.js
@@ -5,3 +5,3 @@ 'use strict'; | ||
const isMacos = process.platform === 'darwin'; | ||
const isMacOS = process.platform === 'darwin'; | ||
let version; | ||
@@ -12,4 +12,4 @@ | ||
const getVersion = () => { | ||
if (!isMacos) { | ||
throw new Error('Requires macOS'); | ||
if (!isMacOS) { | ||
return; | ||
} | ||
@@ -22,3 +22,3 @@ | ||
if (!matches) { | ||
throw new Error('Couldn\'t find the macOS version'); | ||
return; | ||
} | ||
@@ -29,3 +29,5 @@ | ||
return clean(version); | ||
if (version) { | ||
return clean(version); | ||
} | ||
}; | ||
@@ -37,4 +39,6 @@ | ||
x.isMacOS = isMacOS; | ||
x.is = input => { | ||
if (!isMacos) { | ||
if (!isMacOS) { | ||
return false; | ||
@@ -46,4 +50,10 @@ } | ||
x.assertMacOS = () => { | ||
if (!isMacOS) { | ||
throw new Error('Requires macOS'); | ||
} | ||
}; | ||
x.isGreaterThanOrEqualTo = input => { | ||
if (!isMacos) { | ||
if (!isMacOS) { | ||
return false; | ||
@@ -50,0 +60,0 @@ } |
{ | ||
"name": "macos-version", | ||
"version": "4.0.1", | ||
"version": "4.1.0", | ||
"description": "Get or check the current macOS version", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -53,3 +53,11 @@ # macos-version [![Build Status](https://travis-ci.org/sindresorhus/macos-version.svg?branch=master)](https://travis-ci.org/sindresorhus/macos-version) | ||
### assertMacOS() | ||
Throws an error if platform is not macOS. | ||
### .isMacOS | ||
True if platform is macOS. | ||
## Related | ||
@@ -56,0 +64,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4746
52
71