Options for IP address validation.

interface IsIPOptions {
    allowRange?: boolean;
    version?:
        | 4
        | 6
        | "4"
        | "6";
}

Properties

allowRange?: boolean

Allows IP range input (e.g., "127.0.0.1/24", "2001::/128") if true. Defaults to false.

version?:
    | 4
    | 6
    | "4"
    | "6"

IP version to check (4, 6, "4", or "6"). Defaults to undefined (allows both versions).