From f4d7b2a2b0be48c62e1a14471914a664ceb5ea0a Mon Sep 17 00:00:00 2001 From: Clement <159007607+csanchez-jetdev@users.noreply.github.com> Date: Sun, 2 Aug 2026 01:16:14 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20d=C3=A9pendances=20inutilis=C3=A9es,?= =?UTF-8?q?=20types=20manquants=20et=20pagination=20SNCF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/components/MapView.client.vue | 6 +- app/components/RoutePanel.vue | 2 +- app/components/SearchBar.vue | 2 +- app/components/StationInput.vue | 2 +- app/composables/useStations.ts | 2 +- package.json | 3 - pnpm-lock.yaml | 421 ++------------------------ server/utils/booking.ts | 2 +- server/utils/coords.ts | 4 +- server/utils/popularity.ts | 2 +- server/utils/routing.ts | 2 +- server/utils/sncf.ts | 35 ++- server/utils/stations.ts | 12 +- {server/utils => shared}/normalize.ts | 0 test/labels.test.ts | 59 ---- test/normalize.test.ts | 2 +- test/roundtrip.test.ts | 23 +- 17 files changed, 102 insertions(+), 477 deletions(-) rename {server/utils => shared}/normalize.ts (100%) diff --git a/app/components/MapView.client.vue b/app/components/MapView.client.vue index c342a75..4dd1418 100644 --- a/app/components/MapView.client.vue +++ b/app/components/MapView.client.vue @@ -241,13 +241,15 @@ function renderRoute(route: RouteResult, selected: number) { const pts: [number, number][] = [] if (it) { const nodes = [it.legs[0]?.fromCoords, ...it.legs.map((l) => l.toCoords)].filter(Boolean) as [number, number][] - nodes.forEach((c, i) => { + // A loop and not `forEach`: inside a callback TypeScript widens `map` back to nullable, + // the guard at the top of the function no longer covering it. + for (const [i, c] of nodes.entries()) { pts.push(c) if (i > 0 && i < nodes.length - 1) { const el = dot('#14b8b0', 14) markers.set(`__via_${i}__`, new maplibregl.Marker({ element: el }).setLngLat([c[1], c[0]]).addTo(map)) } - }) + } if (nodes.length > 1) { map.addSource('route-line', { type: 'geojson', diff --git a/app/components/RoutePanel.vue b/app/components/RoutePanel.vue index 7aa3898..65c0df7 100644 --- a/app/components/RoutePanel.vue +++ b/app/components/RoutePanel.vue @@ -1,7 +1,7 @@