Initial commit
[yaffs-website] / node_modules / is-number / index.js
1 /*!
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
10 var typeOf = require('kind-of');
11
12 module.exports = function isNumber(num) {
13   var type = typeOf(num);
14   if (type !== 'number' && type !== 'string') {
15     return false;
16   }
17   var n = +num;
18   return (n - n + 1) >= 0 && num !== '';
19 };