Skip to content

Latest commit

 

History

History
34 lines (22 loc) · 999 Bytes

README.md

File metadata and controls

34 lines (22 loc) · 999 Bytes

Domain

A domain name parser.

This expects only the domain, www.google.com, not http://www.google.com/?query#hash, use a URI parser first.

Data

public_suffix_list.dat.txt is from publicsuffix.org site. This is used to generate uhx.types.Domain.hx.

Api

enum DomainParts {
    Tld(parts:Array<String>);
    Domain(name:String);
    Subdomain(parts:Array<String>);
}

Domain API

International ccTLD's, like 中国 for China, return the same list as cn would.

class Domain {
    
    public static function initialize():Void;
    public static function parse(domain:String, ?tlds:Array<String->Bool>, ?slds:Array<String->Bool>):haxe.ds.Option<Array<DomainParts>>;
    
}