allow edit of name + address

This commit is contained in:
Emile Nijssen 2021-07-13 20:51:23 +02:00
parent 2966666cc6
commit 016382dd01
11 changed files with 221 additions and 205 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) {