3d-interface/lib/filterInt.js

7 lines
162 B
JavaScript
Raw Normal View History

2015-05-05 11:56:35 +02:00
// Strict parseInt
module.exports.filterInt = function(value) {
if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value))
return Number(value);
return NaN;
}