.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / randomatic / node_modules / is-number / index.js
1 /*!
2  * is-number <https://github.com/jonschlinkert/is-number>
3  *
4  * Copyright (c) 2014-2017, Jon Schlinkert.
5  * Released under the MIT License.
6  */
7
8 'use strict';
9
10 module.exports = function isNumber(num) {
11   var type = typeof num;
12
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)) {
17     return false;
18   }
19
20   return (num - num + 1) >= 0;
21 };