@transportme/load-ptv-gtfs 1.4.11 → 1.4.12
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.
- package/lib/loader/TripLoader.mjs +12 -5
- package/package.json +1 -1
|
@@ -247,13 +247,20 @@ export default class TripLoader {
|
|
|
247
247
|
await this.writeTrips()
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
this.#stopCache = {}
|
|
250
|
+
getTripsToLoad() {
|
|
251
|
+
return this.#tripsToLoad
|
|
252
|
+
}
|
|
254
253
|
|
|
254
|
+
clearTripsToLoad() {
|
|
255
|
+
this.#routeCache = {}
|
|
256
|
+
this.#stopCache = {}
|
|
257
|
+
this.#tripsToLoad = []
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
async writeTrips() {
|
|
261
|
+
if (this.getTripsToLoad().length) {
|
|
255
262
|
await this.#trips.createDocuments(this.#tripsToLoad)
|
|
256
|
-
this
|
|
263
|
+
this.clearTripsToLoad()
|
|
257
264
|
}
|
|
258
265
|
}
|
|
259
266
|
|