Initial commit of nodejs
This commit is contained in:
6
my_modules/filterInt.js
Normal file
6
my_modules/filterInt.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// Strict parseInt
|
||||
module.exports.filterInt = function(value) {
|
||||
if(/^(\-|\+)?([0-9]+|Infinity)$/.test(value))
|
||||
return Number(value);
|
||||
return NaN;
|
||||
}
|
||||
Reference in New Issue
Block a user