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