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 URLsChangelog
4.0.0
2019-01-07
This Release introduces some more optimizations both in size of bundles,
memory usage and speed of parsing. Because it introduces some breaking
changes in the API results (host
renamed into hostname
and deletion
of the isValid
attribute), as well as introducing a new experimental
backend (tldts-experimental
bundle), this is a major version bump.
#16 Optimizations + comparison with other libraries (#16)
#13 Implement experimental probabilistic packed suffix structure (#13)