IOweb/node_modules/@astrojs/sitemap/dist/utils/lastmod.js
2026-07-03 15:07:38 -05:00

15 lines
381 B
JavaScript

function getLatestLastmod(items) {
let latest;
for (const item of items) {
if (!item.lastmod) continue;
const time = new Date(item.lastmod).getTime();
if (Number.isNaN(time)) continue;
if (latest === void 0 || time > latest) {
latest = time;
}
}
return latest === void 0 ? void 0 : new Date(latest).toISOString();
}
export {
getLatestLastmod
};