mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 17:29:50 +03:00
Syslog host setting as ipv4 or hostname
This commit is contained in:
5
interface/src/validators/isIPv4.ts
Normal file
5
interface/src/validators/isIPv4.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
const ipv4AddressRegexp = /^(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 isIpv4(ipAddress: string) {
|
||||
return ipv4AddressRegexp.test(ipAddress);
|
||||
}
|
||||
Reference in New Issue
Block a user