github-pages-deploy-action/node_modules/is-number/index.js

23 lines
420 B
JavaScript
Raw Normal View History

2020-03-31 20:42:07 +08:00
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
2020-03-31 20:57:48 +08:00
* Copyright (c) 2014-2015, Jon Schlinkert.
* Licensed under the MIT License.
2020-03-31 20:42:07 +08:00
*/
'use strict';
2020-03-31 20:57:48 +08:00
var typeOf = require('kind-of');
module.exports = function isNumber(num) {
var type = typeOf(num);
if (type === 'string') {
if (!num.trim()) return false;
} else if (type !== 'number') {
return false;
2020-03-31 20:42:07 +08:00
}
2020-03-31 20:57:48 +08:00
return (num - num + 1) >= 0;
2020-03-31 20:42:07 +08:00
};