1 | /*!
|
2 | * is-number <https://github.com/jonschlinkert/is-number>
|
3 | *
|
4 | * Copyright (c) 2014-present, Jon Schlinkert.
|
5 | * Released under the MIT License.
|
6 | */
|
7 |
|
8 | ;
|
9 |
|
10 | module.exports = function(num) {
|
11 | if (typeof num === 'number') {
|
12 | return num - num === 0;
|
13 | }
|
14 | if (typeof num === 'string' && num.trim() !== '') {
|
15 | return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
|
16 | }
|
17 | return false;
|
18 | };
|