bjarneo / extract-domain

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

Problem with returning domains with no subdomain #12

Closed lf-gcote closed 3 years ago

lf-gcote commented 3 years ago

I'm currently using this library to extract the domain of a website and I'm running into issues.

https://www.test.com returns test.com https://test.com returns null

Expected result: https://test.com returns test.com

EDIT: The TLD option is set to TRUE EDIT2: When the TLD option is set to FALSE, everything works accordingly

bjarneo commented 3 years ago

Ahh, great catch. Will look into this. Thank you!

bjarneo commented 3 years ago

Should be fixed in version extract-domain@2.3.4

bjarneo commented 3 years ago

https://github.com/bjarneo/extract-domain/commit/2dc222c73d19d2dd4f7225faddd85a1e3c323658