INNER CODE UNIT · TypeScript

locRegex

niledatabase/niledatabase · www/app/sitemap.ts:38

      const locRegex = /<loc>(.*?)<\/loc>/;
      const lastmodRegex = /<lastmod>(.*?)<\/lastmod>/;

      let match;
      while ((match = urlRegex.exec(xml)) !== null) {
        const urlBlock = match[1];
        const locMatch = locRegex.exec(urlBlock);
        const lastmodMatch = lastmodRegex.exec(urlBlock);

        if (locMatch && locMatch[1]) {
          let url = locMatch[1];
          // Ensure www.thenile.dev
          url = url.replace('https://thenile.dev', 'https://www.thenile.dev');

          docsPages.push({
            url,
            lastModified: lastmodMatch ? new Date(lastmodMatch[1]) : new Date(),
            changeFrequency: 'weekly',

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…