bjarneo / extract-domain

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

fails to extract with path #32

Open ashubham opened 11 months ago

ashubham commented 11 months ago
extractDomain(["mother.com/q/s"])

Output should be: mother.com but instead it is mother.com/q/s.

bjarneo commented 11 months ago

I understand your issue here, but this is not a complete URL.

As described in the readme: https://developer.mozilla.org/en-US/docs/Learn/Common_questions/Web_mechanics/What_is_a_URL

However, of course it would be nice to support a case like this as well, so I will keep the issue open.