Changelog
5.0.0
2019-05-23
extractHostname
: will now avoid lower-casing the result in some casesextractHostname
: handles single or triple '/' after protocolextractHostname
: has fast-path for validation of common protocols (e.g. https)isProbablyIpv4
: performs first quick check on length of hostnameisProbablyIpv6
: performs first quick check on length of hostnameisValidHostname
: make use of charCodeAt
instead of codePointAt
lookupInTrie
: makes use of Trie with more stable structure (faster)lookupInTrie
: lazily allocate memory for resultsuffixLookup
: uses fast-path for most common suffixes (massive speed-up)suffixLookup
: does not allocate memory for result anymoresetDefaults
: fast-path in case no argument was providedgetSubdomain
: fast-path if subdomain is emptydetectIp
allows to disable IP checkmixedInput
allows to specify if we expect a mix of URLs and hostnames as
input. If only hostnames are expected then extractHostname
can be set to
false
to speed-up parsing. If only URLs are expected then mixedInputs
can be set to false
. The mixedInputs
is only a hint and will not
change the behavior of the library.validateHostname
can be set to false
to disable validation and
speed-up processing further.bin/
folder to TypeScripttldts
cli which can be used to parse URLs