3d-interface/lib/filterInt.js

7 lines
163 B
JavaScript

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