1
0
Fork 0
mirror of synced 2024-09-02 18:51:36 +12:00
budibase/packages/common/node_modules/is-number/index.js

19 lines
411 B
JavaScript
Raw Normal View History

2020-04-08 02:12:08 +12:00
/*!
* is-number <https://github.com/jonschlinkert/is-number>
*
* Copyright (c) 2014-present, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
module.exports = function(num) {
if (typeof num === 'number') {
return num - num === 0;
}
if (typeof num === 'string' && num.trim() !== '') {
return Number.isFinite ? Number.isFinite(+num) : isFinite(+num);
}
return false;
};