Ensure sitemap dates exist before sorting
This commit is contained in:
parent
46e6ae2310
commit
bdba4c8c7d
@ -47,7 +47,7 @@ export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
|
||||
...focalLengths.map(({ lastModified }) => lastModified),
|
||||
...photos.map(({ updatedAt }) => updatedAt),
|
||||
]
|
||||
.filter(Boolean)
|
||||
.filter(date => date instanceof Date)
|
||||
.sort((a, b) => b.getTime() - a.getTime())[0];
|
||||
|
||||
return [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user