diggy
Version:
Multi-backend DNS resolver for Node.js/Browser — supports dig, DNS over HTTPS, and native Node.js DNS.
17 lines (16 loc) • 659 B
TypeScript
import { DNSRecordType } from "../types";
/**
* 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`.
*
* @example
* ```ts
* import { toDnsType } from "diggy";
* console.log(toDnsType("A")); // Output: "A"
* console.log(toDnsType("MX")); // Output: "MX"
* console.log(toDnsType("INVALID")); // Output: undefined
* ```
* @param type - The string representation of the DNS record type (e.g., "A", "AAAA", "MX").
* @group Utilities
*/
export declare function toDnsType(type?: string): DNSRecordType | undefined;