minotor 5.0.0 → 5.0.1

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/CHANGELOG.md CHANGED
@@ -1,12 +1,6 @@
1
- # [5.0.0](https://github.com/aubryio/minotor/compare/v4.0.0...v5.0.0) (2025-09-13)
1
+ ## [5.0.1](https://github.com/aubryio/minotor/compare/v5.0.0...v5.0.1) (2025-09-13)
2
2
 
3
3
 
4
- ### Performance Improvements
4
+ ### Bug Fixes
5
5
 
6
- * store routeIds as integers ([#23](https://github.com/aubryio/minotor/issues/23)) ([c347da7](https://github.com/aubryio/minotor/commit/c347da7b69664d9682ab27a3508b5cf253cb6651))
7
-
8
-
9
- ### BREAKING CHANGES
10
-
11
- * RouteIds are now represented as integers, older timetables are not supported
12
- anymore.
6
+ * use platform_code for parsing swiss GTFS ([#24](https://github.com/aubryio/minotor/issues/24)) ([62d31a3](https://github.com/aubryio/minotor/commit/62d31a396da296e95dc800ba816820a67832e9c2)), closes [#20](https://github.com/aubryio/minotor/issues/20)
package/dist/cli.mjs CHANGED
@@ -18151,12 +18151,6 @@ const standardProfile = {
18151
18151
  return undefined;
18152
18152
  }
18153
18153
  },
18154
- platformParser: (stopEntry) => {
18155
- if (stopEntry.platform_code) {
18156
- return stopEntry.platform_code;
18157
- }
18158
- return undefined;
18159
- },
18160
18154
  };
18161
18155
 
18162
18156
  const is_object = function (obj) {
@@ -20254,7 +20248,7 @@ const parseCalendarDates = (calendarDatesStream, serviceIds, date) => __awaiter(
20254
20248
  * @param stopsStream The readable stream containing the stops data.
20255
20249
  * @return A mapping of stop IDs to corresponding stop details.
20256
20250
  */
20257
- const parseStops = (stopsStream, platformParser) => __awaiter(void 0, void 0, void 0, function* () {
20251
+ const parseStops = (stopsStream) => __awaiter(void 0, void 0, void 0, function* () {
20258
20252
  var _a, e_1, _b, _c;
20259
20253
  const parsedStops = new Map();
20260
20254
  let i = 0;
@@ -20268,20 +20262,9 @@ const parseStops = (stopsStream, platformParser) => __awaiter(void 0, void 0, vo
20268
20262
  _d = false;
20269
20263
  const rawLine = _c;
20270
20264
  const line = rawLine;
20271
- const stop = Object.assign({ id: i, sourceStopId: line.stop_id, name: line.stop_name, lat: line.stop_lat, lon: line.stop_lon, locationType: line.location_type
20265
+ const stop = Object.assign(Object.assign(Object.assign({ id: i, sourceStopId: line.stop_id, name: line.stop_name, lat: line.stop_lat, lon: line.stop_lon, locationType: line.location_type
20272
20266
  ? parseGtfsLocationType(line.location_type)
20273
- : 'SIMPLE_STOP_OR_PLATFORM', children: [] }, (line.parent_station && { parentSourceId: line.parent_station }));
20274
- if (platformParser) {
20275
- try {
20276
- const platform = platformParser(line);
20277
- if (platform) {
20278
- stop.platform = platform;
20279
- }
20280
- }
20281
- catch (_g) {
20282
- console.info(`Could not parse platform for stop ${line.stop_id}.`);
20283
- }
20284
- }
20267
+ : 'SIMPLE_STOP_OR_PLATFORM' }, (line.platform_code && { platform: line.platform_code })), { children: [] }), (line.parent_station && { parentSourceId: line.parent_station }));
20285
20268
  parsedStops.set(line.stop_id, stop);
20286
20269
  i = i + 1;
20287
20270
  }
@@ -20743,7 +20726,7 @@ class GtfsParser {
20743
20726
  log.info(`Parsing ${STOPS_FILE}`);
20744
20727
  const stopsStart = performance.now();
20745
20728
  const stopsStream = yield zip.stream(STOPS_FILE);
20746
- const parsedStops = yield parseStops(stopsStream, this.profile.platformParser);
20729
+ const parsedStops = yield parseStops(stopsStream);
20747
20730
  const stopsEnd = performance.now();
20748
20731
  log.info(`${parsedStops.size} parsed stops. (${(stopsEnd - stopsStart).toFixed(2)}ms)`);
20749
20732
  if (entries[CALENDAR_FILE]) {
@@ -20819,7 +20802,7 @@ class GtfsParser {
20819
20802
  log.info(`Parsing ${STOPS_FILE}`);
20820
20803
  const stopsStart = performance.now();
20821
20804
  const stopsStream = yield zip.stream(STOPS_FILE);
20822
- const stops = indexStops(yield parseStops(stopsStream, this.profile.platformParser));
20805
+ const stops = indexStops(yield parseStops(stopsStream));
20823
20806
  const stopsEnd = performance.now();
20824
20807
  log.info(`${stops.size} parsed stops. (${(stopsEnd - stopsStart).toFixed(2)}ms)`);
20825
20808
  yield zip.close();
@@ -20828,19 +20811,6 @@ class GtfsParser {
20828
20811
  }
20829
20812
  }
20830
20813
 
20831
- /**
20832
- * Parses the platform number from a stop entry.
20833
- * @param stopEntry The stop entry.
20834
- * @returns The platform corresponding to this stop.
20835
- */
20836
- const platformParser = (stopEntry) => {
20837
- const stopId = stopEntry.stop_id;
20838
- const stopParts = stopId.split(':');
20839
- if (stopParts.length > 2) {
20840
- return stopParts[2];
20841
- }
20842
- return undefined;
20843
- };
20844
20814
  /**
20845
20815
  * Parses the SBB extended route type and returns the corresponding basic GTFS route type.
20846
20816
  * @param routeType The SBB route type to parse.
@@ -20867,6 +20837,7 @@ const routeTypeParser = (routeType) => {
20867
20837
  return 'FERRY'; // Boat
20868
20838
  case 900: // Tram
20869
20839
  return 'TRAM'; // Tram
20840
+ case 116: // ??? train TODO figure out what this means
20870
20841
  case 117: // Special train
20871
20842
  case 102: // International train
20872
20843
  case 104: // Car train
@@ -20878,7 +20849,6 @@ const routeTypeParser = (routeType) => {
20878
20849
  case 100: // No guaranteed train
20879
20850
  case 106: // Regional train
20880
20851
  case 109: // Urban train
20881
- case 116: // ??? train TODO figure out what this means
20882
20852
  return 'RAIL'; // Train
20883
20853
  case 1100: // Aircraft
20884
20854
  case 1500: // Taxi
@@ -20888,7 +20858,6 @@ const routeTypeParser = (routeType) => {
20888
20858
  };
20889
20859
  const chGtfsProfile = {
20890
20860
  routeTypeParser,
20891
- platformParser,
20892
20861
  };
20893
20862
 
20894
20863
  class Plotter {