(urls)
| 22 | Array.from(xml.matchAll(/<loc>(.*?)<\/loc>/gu), (match) => match[1]); |
| 23 | |
| 24 | const normalizeUrls = (urls) => |
| 25 | Array.from( |
| 26 | new Set( |
| 27 | urls |
| 28 | .map((url) => url.trim()) |
| 29 | .filter(Boolean) |
| 30 | .map((url) => (url.startsWith("http") ? url : `https://${host}${url}`)), |
| 31 | ), |
| 32 | ); |
| 33 | |
| 34 | const readSitemapUrls = async () => { |
| 35 | const sitemapPath = path.join(cwd, "dist", "sitemap.xml"); |