UNPKG

tastypie

Version:

Tastypie is a webservice API framework for Node.js based on Django's Tastypie Framework. It provides a convenient, yet powerful and highly customizable, abstraction for creating REST-style interfaces

21 lines (16 loc) 490 B
var isNumber = require('./isNumber'); var GLOBAL = require('./GLOBAL'); /** * Check if value is finite */ function isFinite(val){ var is = false; if (typeof val === 'string' && val !== '') { is = GLOBAL.isFinite( parseFloat(val) ); } else if (isNumber(val)){ // need to use isNumber because of Number constructor is = GLOBAL.isFinite( val ); } return is; } module.exports = isFinite;