diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/is-number | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) | |
download | wallet-core-363723fc84f7b8477592e0105aeb331ec9a017af.tar.xz |
node_modules
Diffstat (limited to 'node_modules/is-number')
-rw-r--r-- | node_modules/is-number/LICENSE | 2 | ||||
-rw-r--r-- | node_modules/is-number/README.md | 58 | ||||
-rw-r--r-- | node_modules/is-number/index.js | 9 | ||||
-rw-r--r-- | node_modules/is-number/package.json | 48 |
4 files changed, 78 insertions, 39 deletions
diff --git a/node_modules/is-number/LICENSE b/node_modules/is-number/LICENSE index fa30c4cb3..842218cf0 100644 --- a/node_modules/is-number/LICENSE +++ b/node_modules/is-number/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2015, Jon Schlinkert. +Copyright (c) 2014-2016, 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 diff --git a/node_modules/is-number/README.md b/node_modules/is-number/README.md index 8395f9131..281165dce 100644 --- a/node_modules/is-number/README.md +++ b/node_modules/is-number/README.md @@ -1,19 +1,19 @@ -# 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 ``` ## Usage +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 var isNumber = require('is-number'); ``` @@ -65,39 +65,51 @@ isNumber(undefined) //=> 'false' isNumber({abc: 'abc'}) //=> 'false' ``` -## Other projects +## About + +### Related projects + +* [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.") -* [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 -## Contributing +Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new). -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/is-number/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 +``` -## Run tests +### 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._
\ No newline at end of file +_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.30, on September 10, 2016._
\ No newline at end of file diff --git a/node_modules/is-number/index.js b/node_modules/is-number/index.js index 96ec66d5e..7a2a45bed 100644 --- a/node_modules/is-number/index.js +++ b/node_modules/is-number/index.js @@ -11,9 +11,12 @@ var typeOf = require('kind-of'); module.exports = function isNumber(num) { 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; }; diff --git a/node_modules/is-number/package.json b/node_modules/is-number/package.json index 8e30b1301..8c1f9ab48 100644 --- a/node_modules/is-number/package.json +++ b/node_modules/is-number/package.json @@ -1,9 +1,13 @@ { "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", "bugs": { "url": "https://github.com/jonschlinkert/is-number/issues" @@ -23,9 +27,10 @@ "kind-of": "^3.0.2" }, "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" }, "keywords": [ "check", @@ -33,12 +38,16 @@ "coercion", "integer", "is", - "is number", + "is-nan", + "is-num", "is-number", "istype", - "kind of", + "kind", "math", + "nan", + "num", "number", + "numeric", "test", "type", "typeof", @@ -47,13 +56,28 @@ "verb": { "related": { "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" + ] } -} +}
\ No newline at end of file |