type alias ClassifiedAddressv4

Result of classifying an IPv4 address.

Contains the parsed value, the kind discriminant "ipv4", and the classification label from Classificationv4.

Examples

Example 1

import { assertEquals } from "@std/assert";
import { classifyAddress } from "@hertzg/ip/classify";
import { parseAddressv4 } from "@hertzg/ip/addressv4";

const result = classifyAddress(parseAddressv4("10.0.0.1").address);
assertEquals(result.kind, "ipv4");
assertEquals(result.classification, "private");

Properties

readonly
kind: "ipv4"
readonly
value: number

Usage

import { type ClassifiedAddressv4 } from "classify.ts";