Skip to main content

IsIpOrFQDN

Summary

Property decorator that validates whether the value is a valid IPv4/IPv6 address or a fully qualified domain name (FQDN).

Signature

Parameters

validationOptions

Type:ValidationOptions Optional: Yes Optional class-validator validation options.

Returns

Type:(object: object, propertyName: string) => void Property decorator that validates whether the value is a valid IPv4/IPv6 address or a fully qualified domain name (FQDN).

Remarks

Built on top of class-validator’s isIP and isFQDN helpers. Use on config properties that represent server hostnames or addresses.

Examples

Example 1