gtfs-to-html 2.11.2 → 2.11.3

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/app/index.js CHANGED
@@ -430,7 +430,7 @@ function getAgencyGeoJSON(config2) {
430
430
  // package.json
431
431
  var package_default = {
432
432
  name: "gtfs-to-html",
433
- version: "2.11.2",
433
+ version: "2.11.3",
434
434
  private: false,
435
435
  description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
436
436
  keywords: [
@@ -492,7 +492,7 @@ var package_default = {
492
492
  pbf: "^4.0.1",
493
493
  "pretty-error": "^4.0.0",
494
494
  pug: "^3.0.3",
495
- puppeteer: "^24.21.0",
495
+ puppeteer: "^24.23.0",
496
496
  "sanitize-filename": "^1.6.3",
497
497
  "sanitize-html": "^2.17.0",
498
498
  sqlstring: "^2.3.3",
@@ -502,22 +502,23 @@ var package_default = {
502
502
  },
503
503
  devDependencies: {
504
504
  "@types/archiver": "^6.0.3",
505
+ "@types/cli-table": "^0.3.4",
505
506
  "@types/express": "^5.0.3",
506
507
  "@types/insane": "^1.0.0",
507
508
  "@types/js-beautify": "^1.14.3",
508
509
  "@types/lodash-es": "^4.17.12",
509
510
  "@types/morgan": "^1.9.10",
510
- "@types/node": "^22",
511
+ "@types/node": "^24",
511
512
  "@types/pug": "^2.0.10",
512
513
  "@types/sanitize-html": "^2.16.0",
513
514
  "@types/sqlstring": "^2.3.2",
514
515
  "@types/toposort": "^2.0.7",
515
516
  "@types/yargs": "^17.0.33",
516
517
  husky: "^9.1.7",
517
- "lint-staged": "^16.1.6",
518
+ "lint-staged": "^16.2.3",
518
519
  prettier: "^3.6.2",
519
520
  tsup: "^8.5.0",
520
- typescript: "^5.9.2"
521
+ typescript: "^5.9.3"
521
522
  },
522
523
  engines: {
523
524
  node: ">= 22"
@@ -644,9 +645,6 @@ var sortTrips = (trips, config2) => {
644
645
  const lastStopId = last(longestTripStoptimes).stop_id;
645
646
  sortedTrips = sortTripsByStoptimeAtStop(trips, lastStopId);
646
647
  }
647
- if (config2.showDuplicateTrips === false) {
648
- return deduplicateTrips(sortedTrips ?? []);
649
- }
650
648
  return sortedTrips ?? [];
651
649
  };
652
650
  var sortTripsByStoptimeAtStop = (trips, stopId) => sortBy(trips, (trip) => {
@@ -1275,7 +1273,7 @@ var addTripContinuation = (trip, timetable) => {
1275
1273
  trip.continues_as_route = nextTrip;
1276
1274
  }
1277
1275
  };
1278
- var filterTrips = (timetable) => {
1276
+ var filterTrips = (timetable, config2) => {
1279
1277
  let filteredTrips = timetable.orderedTrips;
1280
1278
  for (const trip of filteredTrips) {
1281
1279
  const combinedStoptimes = [];
@@ -1299,6 +1297,9 @@ var filterTrips = (timetable) => {
1299
1297
  filteredTrips = filteredTrips.filter(
1300
1298
  (trip) => trip.stoptimes.length > 1
1301
1299
  );
1300
+ if (config2.showDuplicateTrips === false) {
1301
+ filteredTrips = deduplicateTrips(filteredTrips);
1302
+ }
1302
1303
  return filteredTrips;
1303
1304
  };
1304
1305
  var getTripsForTimetable = (timetable, calendars, config2) => {
@@ -1436,7 +1437,10 @@ var formatTimetables = (timetables, config2) => {
1436
1437
  if (config2.showMap) {
1437
1438
  timetable.geojson = getTimetableGeoJSON(timetable, config2);
1438
1439
  }
1439
- timetable.orderedTrips = filterTrips(timetable);
1440
+ timetable.trip_ids = uniq(
1441
+ timetable.orderedTrips.map((trip) => trip.trip_id)
1442
+ );
1443
+ timetable.orderedTrips = filterTrips(timetable, config2);
1440
1444
  timetable.stops = formatStops(timetable, config2);
1441
1445
  return timetable;
1442
1446
  });
@@ -1541,7 +1545,9 @@ var getTimetablePageById = (timetablePageId, config2) => {
1541
1545
  const timetablePages = getTimetablePages({
1542
1546
  timetable_page_id: timetablePageId
1543
1547
  });
1544
- const timetables = mergeTimetablesWithSameId(getTimetables());
1548
+ const timetables = mergeTimetablesWithSameId(
1549
+ getTimetables()
1550
+ );
1545
1551
  if (timetablePages.length > 1) {
1546
1552
  throw new Error(
1547
1553
  `Multiple timetable_pages found for timetable_page_id=${timetablePageId}`