@adguard/agtree
Version:
Tool set for working with adblock filter lists
30 lines (29 loc) • 827 B
TypeScript
/**
* @file Utility functions for domain and hostname validation.
*/
/**
* Marker for a wildcard top-level domain — `.*`.
*
* @example
* `example.*` — matches with any TLD, e.g. `example.org`, `example.com`, etc.
*/
export declare const WILDCARD_TLD: string;
/**
* Marker for a wildcard subdomain — `*.`.
*
* @example
* `*.example.org` — matches with any subdomain, e.g. `foo.example.org` or `bar.example.org`
*/
export declare const WILDCARD_SUBDOMAIN: string;
/**
* Utility functions for domain and hostname validation.
*/
export declare class DomainUtils {
/**
* Check if the input is a valid domain or hostname.
*
* @param domain Domain to check
* @returns `true` if the domain is valid, `false` otherwise
*/
static isValidDomainOrHostname(domain: string): boolean;
}