diggy - v1.1.5
    Preparing search index...

    Function toDnsType

    • Converts a string representation of a DNS record type to the corresponding DNSRecordType enum value. If the input string does not match any valid DNS record type, it returns undefined.

      Parameters

      • Optionaltype: string

        The string representation of the DNS record type (e.g., "A", "AAAA", "MX").

      Returns string | undefined

      import { toDnsType } from "diggy";
      console.log(toDnsType("A")); // Output: "A"
      console.log(toDnsType("MX")); // Output: "MX"
      console.log(toDnsType("INVALID")); // Output: undefined