Revert "feat: cidr notation"

This commit is contained in:
Philip H 2024-03-27 14:41:31 +01:00 committed by GitHub
parent cb63d5c67f
commit bf214fb4d3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 29 additions and 44 deletions

View file

@ -4,6 +4,19 @@ const childProcess = require('child_process');
module.exports = class Util {
static isValidIPv4(str) {
const blocks = str.split('.');
if (blocks.length !== 4) return false;
for (let value of blocks) {
value = parseInt(value, 10);
if (Number.isNaN(value)) return false;
if (value < 0 || value > 255) return false;
}
return true;
}
static promisify(fn) {
// eslint-disable-next-line func-names
return function(req, res) {