Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

IsIP

  • IsIP(version?: number, validationOptions?: ValidationOptions): (object: any, propertyName: string) => void
  • Decorator that checks if the property value is an IP.

    Example

    class IsIPDemo {
    @IsIP()
    e:any = '127.0.0.1'
    }

    Parameters

    • Optional version: number

      The IP version (Optional: 4 or 6).

    • Optional validationOptions: ValidationOptions

      The validation options

    Returns (object: any, propertyName: string) => void

      • (object: any, propertyName: string): void
      • Parameters

        • object: any
        • propertyName: string

        Returns void

validateArray

  • Parameters

    Returns number[]

    An empty array if valid, an array of indexes otherwise.

validateValue

  • Value is valid if it passes the {@link isIP} check.

    Parameters

    • vc: ValidationContext

      The validation context.

    • o: any

      The object containing the property to validate.

    Returns boolean

    The result of the call to {@link isIP}

Generated using TypeDoc