initial commit of C++ back end and react front end

This commit is contained in:
rjwats@gmail.com
2018-02-26 00:11:31 +00:00
commit 63a639eb22
87 changed files with 14975 additions and 0 deletions

View File

@ -0,0 +1,6 @@
const hostnameLengthRegex = /^.{0,32}$/
const hostnamePatternRegex = /^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9-]*[A-Za-z0-9])$/
export default function isHostname(hostname) {
return hostnameLengthRegex.test(hostname) && hostnamePatternRegex.test(hostname);
}

View File

@ -0,0 +1,5 @@
const ipAddressRegexp = /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
export default function isIp(ipAddress) {
return ipAddressRegexp.test(ipAddress);
}

View File

@ -0,0 +1 @@
export default validator => value => !value || validator(value);

View File

@ -0,0 +1 @@
export default (validator1, validator2) => value => validator1(value) || validator2(value);