fix: remove regex from input
This commit is contained in:
parent
013edd51e3
commit
dd41381b73
|
@ -19,8 +19,8 @@ const f = async () => {
|
|||
const domains = new Set()
|
||||
|
||||
for (const { url } of domainsArray) {
|
||||
const parsedUrl = new URL(url)
|
||||
const domain = parsedUrl.hostname.replace(/\\/g, '').replace(/^(\*|www)\./, '')
|
||||
const parsedUrl = new URL(url.replace(/\*\./g, ''))
|
||||
const domain = parsedUrl.hostname.replace(/\\/g, '').replace(/^www\./, '')
|
||||
domains.add(domain)
|
||||
}
|
||||
for (const { url } of linksArray) {
|
||||
|
|
Loading…
Reference in New Issue