2 * is-number <https://github.com/jonschlinkert/is-number>
4 * Copyright (c) 2014-2017, Jon Schlinkert.
5 * Released under the MIT License.
10 module.exports = function isNumber(num) {
11 var type = typeof num;
13 if (type === 'string' || num instanceof String) {
14 // an empty string would be coerced to true with the below logic
15 if (!num.trim()) return false;
16 } else if (type !== 'number' && !(num instanceof Number)) {
20 return (num - num + 1) >= 0;