bjarneo / extract-domain

Extract domain name from an URL
https://www.npmjs.com/package/extract-domain
MIT License
31 stars 4 forks source link

Incorrect parse #11

Closed irasanchez closed 3 years ago

irasanchez commented 3 years ago

This array of URLS

["https://www.independent.co.uk/travel/news-and-advi…terdam-rome-venice-warsaw-dubrovnik-a8108096.html", "https://www.ipsf.org.il/?section=20", "https://timesofindia.indiatimes.com/blogs/voices/g…up-for-sustainable-tourism-in-a-post-covid-world/"]

returns this array of strings ["co.uk", "org.il", "indiatimes.com"]

The first two aren't working properly for some reason.

bjarneo commented 3 years ago

Hi. You should use the { tld: true } option.

bjarneo commented 3 years ago

https://github.com/bjarneo/extract-domain/issues/10

bjarneo commented 3 years ago

With the option flag.

➜  extract-domain-test node index.js
[ 'independent.co.uk', 'ipsf.org.il', 'indiatimes.com' ]
irasanchez commented 3 years ago

Hi. You should use the { tld: true } option.

Perfect, thank you!