is-positive
Advanced tools
Comparing version 2.0.0 to 3.0.0
'use strict'; | ||
module.exports = function (n) { | ||
if (typeof n !== 'number') { | ||
throw new TypeError('Expected a number'); | ||
} | ||
return n > 0; | ||
return typeof n === 'number' && n > 0; | ||
}; |
{ | ||
"name": "is-positive", | ||
"version": "2.0.0", | ||
"description": "Test if a number is positive", | ||
"version": "3.0.0", | ||
"description": "Check if something is a positive number", | ||
"license": "MIT", | ||
@@ -24,3 +24,4 @@ "repository": "kevva/is-positive", | ||
"positive", | ||
"test" | ||
"test", | ||
"check" | ||
], | ||
@@ -27,0 +28,0 @@ "devDependencies": { |
# is-positive [](https://travis-ci.org/kevva/is-positive) | ||
> Test if a number is positive | ||
> Check if something is a positive number | ||
@@ -26,2 +26,5 @@ | ||
//=> false | ||
isPositive('1'); | ||
//=> false | ||
``` | ||
@@ -28,0 +31,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2218
35
4