blob: 7a2a45bed02f5815915218e4b97d7640754e256f [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001/*!
2 * is-number <https://github.com/jonschlinkert/is-number>
3 *
4 * Copyright (c) 2014-2015, Jon Schlinkert.
5 * Licensed under the MIT License.
6 */
7
8'use strict';
9
10var typeOf = require('kind-of');
11
12module.exports = function isNumber(num) {
13 var type = typeOf(num);
14
15 if (type === 'string') {
16 if (!num.trim()) return false;
17 } else if (type !== 'number') {
18 return false;
19 }
20
21 return (num - num + 1) >= 0;
22};