812e3177775bc03f61fb8f537c6f03a89109f770
[platform/framework/web/crosswalk-tizen.git] /
1 var isNumber = require('./isNumber');
2 var GLOBAL = require('./GLOBAL');
3
4     /**
5      * Check if value is finite
6      */
7     function isFinite(val){
8         var is = false;
9         if (typeof val === 'string' && val !== '') {
10             is = GLOBAL.isFinite( parseFloat(val) );
11         } else if (isNumber(val)){
12             // need to use isNumber because of Number constructor
13             is = GLOBAL.isFinite( val );
14         }
15         return is;
16     }
17
18     module.exports = isFinite;
19
20