aboutsummaryrefslogtreecommitdiff
path: root/node_modules/is-number
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/is-number')
-rw-r--r--node_modules/is-number/LICENSE21
-rw-r--r--node_modules/is-number/README.md103
-rw-r--r--node_modules/is-number/index.js19
-rw-r--r--node_modules/is-number/package.json59
4 files changed, 202 insertions, 0 deletions
diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE
new file mode 100644
index 000000000..fa30c4cb3
--- /dev/null
+++ b/node_modules/is-number/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2015, Jon Schlinkert.
+
+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 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.
diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md
new file mode 100644
index 000000000..8395f9131
--- /dev/null
+++ b/node_modules/is-number/README.md
@@ -0,0 +1,103 @@
+# 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)
+
+> 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/)
+
+```sh
+$ npm i is-number --save
+```
+
+## Usage
+
+```js
+var isNumber = require('is-number');
+```
+
+### true
+
+See the [tests](./test.js) for more examples.
+
+```js
+isNumber(5e3) //=> 'true'
+isNumber(0xff) //=> 'true'
+isNumber(-1.1) //=> 'true'
+isNumber(0) //=> 'true'
+isNumber(1) //=> 'true'
+isNumber(1.1) //=> 'true'
+isNumber(10) //=> 'true'
+isNumber(10.10) //=> 'true'
+isNumber(100) //=> 'true'
+isNumber('-1.1') //=> 'true'
+isNumber('0') //=> 'true'
+isNumber('012') //=> 'true'
+isNumber('0xff') //=> 'true'
+isNumber('1') //=> 'true'
+isNumber('1.1') //=> 'true'
+isNumber('10') //=> 'true'
+isNumber('10.10') //=> 'true'
+isNumber('100') //=> 'true'
+isNumber('5e3') //=> 'true'
+isNumber(parseInt('012')) //=> 'true'
+isNumber(parseFloat('012')) //=> 'true'
+```
+
+### False
+
+See the [tests](./test.js) for more examples.
+
+```js
+isNumber('foo') //=> 'false'
+isNumber([1]) //=> 'false'
+isNumber([]) //=> 'false'
+isNumber(function () {}) //=> 'false'
+isNumber(Infinity) //=> 'false'
+isNumber(NaN) //=> 'false'
+isNumber(new Array('abc')) //=> 'false'
+isNumber(new Array(2)) //=> 'false'
+isNumber(new Buffer('abc')) //=> 'false'
+isNumber(null) //=> 'false'
+isNumber(undefined) //=> 'false'
+isNumber({abc: 'abc'}) //=> 'false'
+```
+
+## Other projects
+
+* [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)
+
+## Contributing
+
+Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/issues/new).
+
+## Run tests
+
+Install dev dependencies:
+
+```sh
+$ npm i -d && npm test
+```
+
+## Author
+
+**Jon Schlinkert**
+
++ [github/jonschlinkert](https://github.com/jonschlinkert)
++ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
+
+## License
+
+Copyright © 2015 Jon Schlinkert
+Released under the MIT license.
+
+***
+
+_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on November 22, 2015._ \ No newline at end of file
diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js
new file mode 100644
index 000000000..96ec66d5e
--- /dev/null
+++ b/node_modules/is-number/index.js
@@ -0,0 +1,19 @@
+/*!
+ * is-number <https://github.com/jonschlinkert/is-number>
+ *
+ * Copyright (c) 2014-2015, Jon Schlinkert.
+ * Licensed under the MIT License.
+ */
+
+'use strict';
+
+var typeOf = require('kind-of');
+
+module.exports = function isNumber(num) {
+ var type = typeOf(num);
+ if (type !== 'number' && type !== 'string') {
+ return false;
+ }
+ var n = +num;
+ return (n - n + 1) >= 0 && num !== '';
+};
diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json
new file mode 100644
index 000000000..8e30b1301
--- /dev/null
+++ b/node_modules/is-number/package.json
@@ -0,0 +1,59 @@
+{
+ "name": "is-number",
+ "description": "Returns true if the value is a number. comprehensive tests.",
+ "version": "2.1.0",
+ "homepage": "https://github.com/jonschlinkert/is-number",
+ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
+ "repository": "jonschlinkert/is-number",
+ "bugs": {
+ "url": "https://github.com/jonschlinkert/is-number/issues"
+ },
+ "license": "MIT",
+ "files": [
+ "index.js"
+ ],
+ "main": "index.js",
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "scripts": {
+ "test": "mocha"
+ },
+ "dependencies": {
+ "kind-of": "^3.0.2"
+ },
+ "devDependencies": {
+ "benchmarked": "^0.1.3",
+ "chalk": "^0.5.1",
+ "mocha": "*"
+ },
+ "keywords": [
+ "check",
+ "coerce",
+ "coercion",
+ "integer",
+ "is",
+ "is number",
+ "is-number",
+ "istype",
+ "kind of",
+ "math",
+ "number",
+ "test",
+ "type",
+ "typeof",
+ "value"
+ ],
+ "verb": {
+ "related": {
+ "list": [
+ "kind-of",
+ "is-primitive",
+ "even",
+ "odd",
+ "is-even",
+ "is-odd"
+ ]
+ }
+ }
+}