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