Fix errors in script

This commit is contained in:
Pieter Vander Vennet 2024-09-02 10:27:53 +02:00
parent 468b895302
commit 48a87aa52f

View file

@ -94,7 +94,7 @@ export class OsmPoiDatabase {
let latestDate: Date = undefined let latestDate: Date = undefined
for (const name of dbs) { for (const name of dbs) {
const date = new Date(name) const date = new Date(name)
if (latestDate.getTime() < date.getTime()) { if (latestDate === undefined || latestDate.getTime() < date.getTime()) {
latest = name latest = name
latestDate = date latestDate = date
} }
@ -104,7 +104,7 @@ export class OsmPoiDatabase {
} }
console.log("Latest database is:", latest) console.log("Latest database is:", latest)
return latest return "osm-poi."+latest
} }
async createNew(date: string) { async createNew(date: string) {