Skip to content

TLD support

Latest
Compare
Choose a tag to compare
@bjarneo bjarneo released this 28 Apr 07:32
· 44 commits to master since this release
5d29e02

version: 2.3.0

The options flag is { tld: true }. This PR will also create a more modern solution to packaging by using microbundle.

Hopefully this will work with tree shaking, so if the TLD flag is not used, it will discard that code. (not verified)

Usage:

extractDomain(URL, { tld: true})

Performance with and without using the TLD flag:

# extract domain 10,000 times
  end ~14 ms (0 s + 13572914 ns)
# extract domain with tld 10,000 times
  end ~4.29 s (4 s + 288108681 ns)

Issues: #6
#1