is-positive
Advanced tools
Comparing version 3.0.0 to 3.1.0
'use strict'; | ||
module.exports = function (n) { | ||
return typeof n === 'number' && n > 0; | ||
return toString.call(n) === '[object Number]' && n > 0; | ||
}; |
{ | ||
"name": "is-positive", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Check if something is a positive number", | ||
@@ -16,3 +16,3 @@ "license": "MIT", | ||
"scripts": { | ||
"test": "node test.js" | ||
"test": "xo && ava" | ||
}, | ||
@@ -29,4 +29,5 @@ "files": [ | ||
"devDependencies": { | ||
"ava": "^0.0.4" | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
} |
@@ -16,3 +16,3 @@ # is-positive [](https://travis-ci.org/kevva/is-positive) | ||
```js | ||
var isPositive = require('is-positive'); | ||
const isPositive = require('is-positive'); | ||
@@ -30,7 +30,17 @@ isPositive(1); | ||
//=> false | ||
isPositive(Number(1)) | ||
//=> true | ||
``` | ||
_Note: This module doesn't consider `0` to be a positive number and doesn't distinguish between `-0` and `0`. If you want to detect `0`, use the [`positive-zero`](https://github.com/sindresorhus/positive-zero) module._ | ||
## Related | ||
- [is-negative](https://github.com/kevva/is-negative) - Check if something is a negative number | ||
## License | ||
MIT © [Kevin Martensson](http://github.com/kevva) |
2607
45
2