mirror of
https://github.com/tiennm99/is-a-good-dev.git
synced 2026-10-13 02:14:43 +00:00
Update utils.js
This commit is contained in:
1 parent
c33c0cdb3d
commit
b615f71695
1 file changed
+7
-1
+7
-1
@@ -1,3 +1,5 @@
|
||||
const invalidDomains = require('./invalid-domains.json');
|
||||
|
||||
module.exports.checkIfValidIP = function(str) {
|
||||
// Check if the IP address is valid
|
||||
const regexExp = /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/gi;
|
||||
@@ -10,4 +12,8 @@ module.exports.checkIfValidFQDN = function(str) {
|
||||
const regexExp = /(?=^.{4,253}$)(^((?!-)[a-zA-Z0-9-]{0,62}[a-zA-Z0-9]\.)+[a-zA-Z]{2,63}$)/gi;
|
||||
|
||||
return regexExp.test(str);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.checkInvalidDomain = function(str) {
|
||||
return invalidDomains.includes(str);
|
||||
}
|
||||
Reference in new issue
Block a user