gtfs-to-html 2.11.2 → 2.11.4

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.
@@ -497,7 +497,7 @@ function formatTripNameForCSV(trip, timetable) {
497
497
  // package.json
498
498
  var package_default = {
499
499
  name: "gtfs-to-html",
500
- version: "2.11.2",
500
+ version: "2.11.4",
501
501
  private: false,
502
502
  description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
503
503
  keywords: [
@@ -522,7 +522,8 @@ var package_default = {
522
522
  "Holly Kvalheim",
523
523
  "Pawajoro",
524
524
  "Andrea Mignone",
525
- "Evo Stamatov"
525
+ "Evo Stamatov",
526
+ "Sebastian Knopf"
526
527
  ],
527
528
  type: "module",
528
529
  main: "./dist/index.js",
@@ -550,16 +551,16 @@ var package_default = {
550
551
  "cli-table": "^0.3.11",
551
552
  "csv-stringify": "^6.6.0",
552
553
  express: "^5.1.0",
553
- gtfs: "^4.18.0",
554
+ gtfs: "^4.18.1",
554
555
  "gtfs-realtime-pbf-js-module": "^1.0.0",
555
556
  "js-beautify": "^1.15.4",
556
557
  "lodash-es": "^4.17.21",
557
- marked: "^16.3.0",
558
+ marked: "^16.4.1",
558
559
  moment: "^2.30.1",
559
560
  pbf: "^4.0.1",
560
561
  "pretty-error": "^4.0.0",
561
562
  pug: "^3.0.3",
562
- puppeteer: "^24.21.0",
563
+ puppeteer: "^24.26.1",
563
564
  "sanitize-filename": "^1.6.3",
564
565
  "sanitize-html": "^2.17.0",
565
566
  sqlstring: "^2.3.3",
@@ -568,23 +569,24 @@ var package_default = {
568
569
  yoctocolors: "^2.1.2"
569
570
  },
570
571
  devDependencies: {
571
- "@types/archiver": "^6.0.3",
572
- "@types/express": "^5.0.3",
572
+ "@types/archiver": "^7.0.0",
573
+ "@types/cli-table": "^0.3.4",
574
+ "@types/express": "^5.0.4",
573
575
  "@types/insane": "^1.0.0",
574
576
  "@types/js-beautify": "^1.14.3",
575
577
  "@types/lodash-es": "^4.17.12",
576
578
  "@types/morgan": "^1.9.10",
577
- "@types/node": "^22",
579
+ "@types/node": "^24",
578
580
  "@types/pug": "^2.0.10",
579
581
  "@types/sanitize-html": "^2.16.0",
580
582
  "@types/sqlstring": "^2.3.2",
581
583
  "@types/toposort": "^2.0.7",
582
- "@types/yargs": "^17.0.33",
584
+ "@types/yargs": "^17.0.34",
583
585
  husky: "^9.1.7",
584
- "lint-staged": "^16.1.6",
586
+ "lint-staged": "^16.2.6",
585
587
  prettier: "^3.6.2",
586
588
  tsup: "^8.5.0",
587
- typescript: "^5.9.2"
589
+ typescript: "^5.9.3"
588
590
  },
589
591
  engines: {
590
592
  node: ">= 22"
@@ -711,9 +713,6 @@ var sortTrips = (trips, config) => {
711
713
  const lastStopId = last(longestTripStoptimes).stop_id;
712
714
  sortedTrips = sortTripsByStoptimeAtStop(trips, lastStopId);
713
715
  }
714
- if (config.showDuplicateTrips === false) {
715
- return deduplicateTrips(sortedTrips ?? []);
716
- }
717
716
  return sortedTrips ?? [];
718
717
  };
719
718
  var sortTripsByStoptimeAtStop = (trips, stopId) => sortBy(trips, (trip) => {
@@ -733,7 +732,7 @@ var getCalendarDatesForTimetable = (timetable, config) => {
733
732
  const excludedDates = /* @__PURE__ */ new Set();
734
733
  const includedDates = /* @__PURE__ */ new Set();
735
734
  for (const calendarDate of calendarDates) {
736
- if (moment2(calendarDate.date, "YYYYMMDD").isBetween(start, end)) {
735
+ if (moment2(calendarDate.date, "YYYYMMDD").isBetween(start, end, "day", "[]")) {
737
736
  if (calendarDate.exception_type === 1) {
738
737
  includedDates.add(formatDate(calendarDate, config.dateFormat));
739
738
  } else if (calendarDate.exception_type === 2) {
@@ -1342,7 +1341,7 @@ var addTripContinuation = (trip, timetable) => {
1342
1341
  trip.continues_as_route = nextTrip;
1343
1342
  }
1344
1343
  };
1345
- var filterTrips = (timetable) => {
1344
+ var filterTrips = (timetable, config) => {
1346
1345
  let filteredTrips = timetable.orderedTrips;
1347
1346
  for (const trip of filteredTrips) {
1348
1347
  const combinedStoptimes = [];
@@ -1366,6 +1365,9 @@ var filterTrips = (timetable) => {
1366
1365
  filteredTrips = filteredTrips.filter(
1367
1366
  (trip) => trip.stoptimes.length > 1
1368
1367
  );
1368
+ if (config.showDuplicateTrips === false) {
1369
+ filteredTrips = deduplicateTrips(filteredTrips);
1370
+ }
1369
1371
  return filteredTrips;
1370
1372
  };
1371
1373
  var getTripsForTimetable = (timetable, calendars, config) => {
@@ -1503,7 +1505,10 @@ var formatTimetables = (timetables, config) => {
1503
1505
  if (config.showMap) {
1504
1506
  timetable.geojson = getTimetableGeoJSON(timetable, config);
1505
1507
  }
1506
- timetable.orderedTrips = filterTrips(timetable);
1508
+ timetable.trip_ids = uniq(
1509
+ timetable.orderedTrips.map((trip) => trip.trip_id)
1510
+ );
1511
+ timetable.orderedTrips = filterTrips(timetable, config);
1507
1512
  timetable.stops = formatStops(timetable, config);
1508
1513
  return timetable;
1509
1514
  });
@@ -1608,7 +1613,9 @@ var getTimetablePageById = (timetablePageId, config) => {
1608
1613
  const timetablePages = getTimetablePages({
1609
1614
  timetable_page_id: timetablePageId
1610
1615
  });
1611
- const timetables = mergeTimetablesWithSameId(getTimetables());
1616
+ const timetables = mergeTimetablesWithSameId(
1617
+ getTimetables()
1618
+ );
1612
1619
  if (timetablePages.length > 1) {
1613
1620
  throw new Error(
1614
1621
  `Multiple timetable_pages found for timetable_page_id=${timetablePageId}`
@@ -1749,6 +1756,7 @@ function setDefaultConfig(initialConfig) {
1749
1756
  noHead: false,
1750
1757
  noPickupSymbol: "**",
1751
1758
  noPickupText: "No pickup available",
1759
+ noRegularServiceDaysText: "No regular service days",
1752
1760
  noServiceSymbol: "-",
1753
1761
  noServiceText: "No service at this stop",
1754
1762
  outputFormat: "html",
@@ -2047,7 +2055,7 @@ function formatDays(calendar, config) {
2047
2055
  }
2048
2056
  }
2049
2057
  if (dayString.length === 0) {
2050
- dayString = "No regular service days";
2058
+ dayString = config.noRegularServiceDaysText;
2051
2059
  }
2052
2060
  return dayString;
2053
2061
  }
@@ -2536,7 +2544,7 @@ var gtfsToHtml = async (initialConfig) => {
2536
2544
  timetablePageId,
2537
2545
  config
2538
2546
  );
2539
- for (const timetable of timetablePage.timetables) {
2547
+ for (const timetable of timetablePage.consolidatedTimetables) {
2540
2548
  if (timetable.warnings) {
2541
2549
  for (const warning of timetable.warnings) {
2542
2550
  stats.warnings.push(warning);