@transportme/load-ptv-gtfs 1.4.32 → 1.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -116,7 +116,12 @@ export default class TripLoader {
|
|
|
116
116
|
if (this.#stopCache[stopGTFSID]) return this.#stopCache[stopGTFSID]
|
|
117
117
|
|
|
118
118
|
let stop = await this.stops.findDocument({
|
|
119
|
-
|
|
119
|
+
bays: {
|
|
120
|
+
$elemMatch: {
|
|
121
|
+
stopGTFSID,
|
|
122
|
+
mode: this.#mode
|
|
123
|
+
}
|
|
124
|
+
}
|
|
120
125
|
})
|
|
121
126
|
|
|
122
127
|
this.#stopCache[stopGTFSID] = stop
|
|
@@ -131,6 +136,7 @@ export default class TripLoader {
|
|
|
131
136
|
let stopData = await this.findMatchingStop(stop.stopID)
|
|
132
137
|
if (!stopData) throw new Error(`Failed to match stop ${stop.stopID} in trip ${tripData.getTripID()}`)
|
|
133
138
|
let bay = stopData.bays.find(bay => bay.stopGTFSID === stop.stopID && bay.mode === this.#mode)
|
|
139
|
+
if (!bay) throw new Error(`Missing bay for given stop ID ${stop.stopID} in trip ${tripData.getTripID()}`)
|
|
134
140
|
|
|
135
141
|
let data = {
|
|
136
142
|
stopName: bay.fullStopName,
|