Documentation
¶
Overview ¶
Package nodeurl ports the parts of Node's url module that PiG needs to match Pi: the WHATWG host parser for file URLs and url.fileURLToPath.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DomainToUnicode ¶
DomainToUnicode is Node's url.domainToUnicode for a host FileHost returned: an IP address is unchanged, and a domain's IDNA labels become Unicode.
func FileHost ¶
FileHost is the WHATWG host parser's result for a file URL's host: an IPv6 address in brackets, a dotted IPv4 address, or a lowercase ASCII domain, where localhost is empty. The input is percent-decoded first, as the parser does.
func FileURLToPath ¶
FileURLToPath converts raw as Node's url.fileURLToPath(raw, {windows}) does: raw is parsed as a WHATWG URL, and a Windows host names a UNC server in Unicode. It returns the Error Node throws for a URL that does not parse, is not a file URL, encodes a path separator, has a host on POSIX, or on Windows has neither a host nor a drive letter.