2016-10-10 03:43:44 +02:00
|
|
|
/*!
|
|
|
|
* 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);
|
2017-08-14 05:01:11 +02:00
|
|
|
|
|
|
|
if (type === 'string') {
|
|
|
|
if (!num.trim()) return false;
|
|
|
|
} else if (type !== 'number') {
|
2016-10-10 03:43:44 +02:00
|
|
|
return false;
|
|
|
|
}
|
2017-08-14 05:01:11 +02:00
|
|
|
|
|
|
|
return (num - num + 1) >= 0;
|
2016-10-10 03:43:44 +02:00
|
|
|
};
|