Comparing version 2.1.0 to 3.0.0
@@ -14,7 +14,10 @@ /*! | ||
var type = typeOf(num); | ||
if (type !== 'number' && type !== 'string') { | ||
if (type === 'string') { | ||
if (!num.trim()) return false; | ||
} else if (type !== 'number') { | ||
return false; | ||
} | ||
var n = +num; | ||
return (n - n + 1) >= 0 && num !== ''; | ||
return (num - num + 1) >= 0; | ||
}; |
{ | ||
"name": "is-number", | ||
"description": "Returns true if the value is a number. comprehensive tests.", | ||
"version": "2.1.0", | ||
"version": "3.0.0", | ||
"homepage": "https://github.com/jonschlinkert/is-number", | ||
"author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
"contributors": [ | ||
"Charlike Mike Reagent (http://www.tunnckocore.tk)", | ||
"Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)" | ||
], | ||
"repository": "jonschlinkert/is-number", | ||
@@ -26,5 +30,6 @@ "bugs": { | ||
"devDependencies": { | ||
"benchmarked": "^0.1.3", | ||
"chalk": "^0.5.1", | ||
"mocha": "*" | ||
"benchmarked": "^0.2.5", | ||
"chalk": "^1.1.3", | ||
"gulp-format-md": "^0.1.10", | ||
"mocha": "^3.0.2" | ||
}, | ||
@@ -37,8 +42,12 @@ "keywords": [ | ||
"is", | ||
"is number", | ||
"is-nan", | ||
"is-num", | ||
"is-number", | ||
"istype", | ||
"kind of", | ||
"kind", | ||
"math", | ||
"nan", | ||
"num", | ||
"number", | ||
"numeric", | ||
"test", | ||
@@ -52,11 +61,26 @@ "type", | ||
"list": [ | ||
"kind-of", | ||
"is-primitive", | ||
"even", | ||
"odd", | ||
"is-even", | ||
"is-odd" | ||
"is-odd", | ||
"is-primitive", | ||
"kind-of", | ||
"odd" | ||
] | ||
} | ||
}, | ||
"toc": false, | ||
"layout": "default", | ||
"tasks": [ | ||
"readme" | ||
], | ||
"plugins": [ | ||
"gulp-format-md" | ||
], | ||
"lint": { | ||
"reflinks": true | ||
}, | ||
"reflinks": [ | ||
"verb", | ||
"verb-generate-readme" | ||
] | ||
} | ||
} | ||
} |
@@ -1,13 +0,11 @@ | ||
# is-number [![NPM version](https://badge.fury.io/js/is-number.svg)](http://badge.fury.io/js/is-number) [![Build Status](https://travis-ci.org/jonschlinkert/is-number.svg)](https://travis-ci.org/jonschlinkert/is-number) | ||
# is-number [![NPM version](https://img.shields.io/npm/v/is-number.svg?style=flat)](https://www.npmjs.com/package/is-number) [![NPM downloads](https://img.shields.io/npm/dm/is-number.svg?style=flat)](https://npmjs.org/package/is-number) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-number.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-number) | ||
> Returns true if the value is a number. comprehensive tests. | ||
To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). | ||
## Install | ||
Install with [npm](https://www.npmjs.com/) | ||
Install with [npm](https://www.npmjs.com/): | ||
```sh | ||
$ npm i is-number --save | ||
$ npm install --save is-number | ||
``` | ||
@@ -17,2 +15,4 @@ | ||
To understand some of the rationale behind the decisions made in this library (and to learn about some oddities of number evaluation in JavaScript), [see this gist](https://gist.github.com/jonschlinkert/e30c70c713da325d0e81). | ||
```js | ||
@@ -69,37 +69,49 @@ var isNumber = require('is-number'); | ||
## Other projects | ||
## About | ||
* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even) | ||
* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even) | ||
* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd) | ||
* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive) | ||
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of) | ||
* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd) | ||
### Related projects | ||
## Contributing | ||
* [even](https://www.npmjs.com/package/even): Get the even numbered items from an array. | [homepage](https://github.com/jonschlinkert/even "Get the even numbered items from an array.") | ||
* [is-even](https://www.npmjs.com/package/is-even): Return true if the given number is even. | [homepage](https://github.com/jonschlinkert/is-even "Return true if the given number is even.") | ||
* [is-odd](https://www.npmjs.com/package/is-odd): Returns true if the given number is odd. | [homepage](https://github.com/jonschlinkert/is-odd "Returns true if the given number is odd.") | ||
* [is-primitive](https://www.npmjs.com/package/is-primitive): Returns `true` if the value is a primitive. | [homepage](https://github.com/jonschlinkert/is-primitive "Returns `true` if the value is a primitive. ") | ||
* [kind-of](https://www.npmjs.com/package/kind-of): Get the native type of a value. | [homepage](https://github.com/jonschlinkert/kind-of "Get the native type of a value.") | ||
* [odd](https://www.npmjs.com/package/odd): Get the odd numbered items from an array. | [homepage](https://github.com/jonschlinkert/odd "Get the odd numbered items from an array.") | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/issues/new). | ||
### Contributing | ||
## Run tests | ||
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). | ||
### Building docs | ||
_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_ | ||
To generate the readme and API documentation with [verb](https://github.com/verbose/verb): | ||
```sh | ||
$ npm install -g verb verb-generate-readme && verb | ||
``` | ||
### Running tests | ||
Install dev dependencies: | ||
```sh | ||
$ npm i -d && npm test | ||
$ npm install -d && npm test | ||
``` | ||
## Author | ||
### Author | ||
**Jon Schlinkert** | ||
+ [github/jonschlinkert](https://github.com/jonschlinkert) | ||
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
* [github/jonschlinkert](https://github.com/jonschlinkert) | ||
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert) | ||
## License | ||
### License | ||
Copyright © 2015 Jon Schlinkert | ||
Released under the MIT license. | ||
Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert). | ||
Released under the [MIT license](https://github.com/jonschlinkert/is-number/blob/master/LICENSE). | ||
*** | ||
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._ | ||
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._ |
Sorry, the diff of this file is not supported yet
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
7498
17
115
4