mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
Syslog host setting as ipv4 or hostname
This commit is contained in:
@@ -3,3 +3,4 @@ export { default as isIP } from './isIP';
|
||||
export { default as optional } from './optional';
|
||||
export { default as or } from './or';
|
||||
export { default as isPath } from './isPath';
|
||||
export { default as isIPv4 } from './isIPv4';
|
||||
|
||||
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