gtfs-to-html 2.9.11 → 2.9.13

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.
@@ -330,7 +330,7 @@ function formatTripNameForCSV(trip, timetable) {
330
330
  }
331
331
 
332
332
  // package.json
333
- var version = "2.9.11";
333
+ var version = "2.9.13";
334
334
 
335
335
  // src/lib/utils.ts
336
336
  var isTimepoint = (stoptime) => {
@@ -467,26 +467,26 @@ var getCalendarDatesForTimetable = (timetable, config) => {
467
467
  );
468
468
  const start = fromGTFSDate(timetable.start_date);
469
469
  const end = fromGTFSDate(timetable.end_date);
470
- const excludedDates = [];
471
- const includedDates = [];
470
+ const excludedDates = /* @__PURE__ */ new Set();
471
+ const includedDates = /* @__PURE__ */ new Set();
472
472
  for (const calendarDate of calendarDates) {
473
473
  if (moment2(calendarDate.date, "YYYYMMDD").isBetween(start, end)) {
474
474
  if (calendarDate.exception_type === 1) {
475
- includedDates.push(formatDate(calendarDate, config.dateFormat));
475
+ includedDates.add(formatDate(calendarDate, config.dateFormat));
476
476
  } else if (calendarDate.exception_type === 2) {
477
- excludedDates.push(formatDate(calendarDate, config.dateFormat));
477
+ excludedDates.add(formatDate(calendarDate, config.dateFormat));
478
478
  }
479
479
  }
480
480
  }
481
- const includedAndExcludedDates = excludedDates.filter(
482
- (date) => includedDates.includes(date)
481
+ const includedAndExcludedDates = new Set(
482
+ [...excludedDates].filter((date) => includedDates.has(date))
483
483
  );
484
484
  return {
485
- excludedDates: excludedDates.filter(
486
- (date) => !includedAndExcludedDates.includes(date)
485
+ excludedDates: [...excludedDates].filter(
486
+ (date) => !includedAndExcludedDates.has(date)
487
487
  ),
488
- includedDates: includedDates.filter(
489
- (date) => !includedAndExcludedDates.includes(date)
488
+ includedDates: [...includedDates].filter(
489
+ (date) => !includedAndExcludedDates.has(date)
490
490
  )
491
491
  };
492
492
  };