minotor 11.3.0 → 11.4.0

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.
@@ -16019,10 +16019,12 @@ const processStopToStopTransfer = (transferEntry, fromStop, toStop, transfers) =
16019
16019
  /**
16020
16020
  * Parses the transfers.txt file from a GTFS feed.
16021
16021
  *
16022
- * @param stopsStream The readable stream containing the stops data.
16023
- * @return A mapping of stop IDs to corresponding stop details.
16022
+ * @param transfersStream The readable stream containing the transfers data.
16023
+ * @param stopsMap The parsed GTFS stops indexed by their source IDs.
16024
+ * @param activeServiceIds The service IDs active for the requested date.
16025
+ * @returns Parsed stop transfers, trip continuations, and guaranteed trip transfers.
16024
16026
  */
16025
- const parseTransfers = (transfersStream, stopsMap) => __awaiter(void 0, void 0, void 0, function* () {
16027
+ const parseTransfers = (transfersStream, stopsMap, activeServiceIds) => __awaiter(void 0, void 0, void 0, function* () {
16026
16028
  var _a, e_1, _b, _c;
16027
16029
  const transfers = new Map();
16028
16030
  const tripContinuations = [];
@@ -16036,6 +16038,10 @@ const parseTransfers = (transfersStream, stopsMap) => __awaiter(void 0, void 0,
16036
16038
  _d = false;
16037
16039
  const rawLine = _c;
16038
16040
  const transferEntry = rawLine;
16041
+ if (transferEntry.service_id &&
16042
+ !activeServiceIds.has(transferEntry.service_id)) {
16043
+ continue;
16044
+ }
16039
16045
  if (transferEntry.transfer_type === 3 ||
16040
16046
  transferEntry.transfer_type === 5) {
16041
16047
  continue;
@@ -16613,7 +16619,7 @@ class GtfsParser {
16613
16619
  log.info(`Parsing ${TRANSFERS_FILE}`);
16614
16620
  const transfersStart = performance.now();
16615
16621
  const transfersStream = yield zip.stream(TRANSFERS_FILE);
16616
- const { transfers: parsedTransfers, tripContinuations: parsedTripContinuations, guaranteedTripTransfers: parsedGuaranteedTripTransfers, } = yield parseTransfers(transfersStream, parsedStops);
16622
+ const { transfers: parsedTransfers, tripContinuations: parsedTripContinuations, guaranteedTripTransfers: parsedGuaranteedTripTransfers, } = yield parseTransfers(transfersStream, parsedStops, activeServiceIds);
16617
16623
  transfers = parsedTransfers;
16618
16624
  tripContinuationsList = parsedTripContinuations;
16619
16625
  guaranteedTripTransfersList = parsedGuaranteedTripTransfers;