fix: remove regex from input

This commit is contained in:
Ming Di Leom 2022-09-10 09:16:38 +00:00
parent 013edd51e3
commit dd41381b73
No known key found for this signature in database
GPG Key ID: 32D3E28E96A695E8
1 changed files with 2 additions and 2 deletions

View File

@ -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) {