INNER CODE UNIT · TypeScript
lastmodRegex
niledatabase/niledatabase · www/app/sitemap.ts:39
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',
priority: 0.5,