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.
- package/dist/app/index.js +27 -19
- package/dist/app/index.js.map +1 -1
- package/dist/bin/gtfs-to-html.js +28 -20
- package/dist/bin/gtfs-to-html.js.map +1 -1
- package/dist/index.d.ts +19 -2
- package/dist/index.js +28 -20
- package/dist/index.js.map +1 -1
- package/package.json +13 -11
- package/views/default/formatting_functions.pug +1 -1
- package/views/default/js/system-map.js +1 -1
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.
|
|
433
|
+
version: "2.11.4",
|
|
434
434
|
private: false,
|
|
435
435
|
description: "Build human readable transit timetables as HTML, PDF or CSV from GTFS",
|
|
436
436
|
keywords: [
|
|
@@ -455,7 +455,8 @@ var package_default = {
|
|
|
455
455
|
"Holly Kvalheim",
|
|
456
456
|
"Pawajoro",
|
|
457
457
|
"Andrea Mignone",
|
|
458
|
-
"Evo Stamatov"
|
|
458
|
+
"Evo Stamatov",
|
|
459
|
+
"Sebastian Knopf"
|
|
459
460
|
],
|
|
460
461
|
type: "module",
|
|
461
462
|
main: "./dist/index.js",
|
|
@@ -483,16 +484,16 @@ var package_default = {
|
|
|
483
484
|
"cli-table": "^0.3.11",
|
|
484
485
|
"csv-stringify": "^6.6.0",
|
|
485
486
|
express: "^5.1.0",
|
|
486
|
-
gtfs: "^4.18.
|
|
487
|
+
gtfs: "^4.18.1",
|
|
487
488
|
"gtfs-realtime-pbf-js-module": "^1.0.0",
|
|
488
489
|
"js-beautify": "^1.15.4",
|
|
489
490
|
"lodash-es": "^4.17.21",
|
|
490
|
-
marked: "^16.
|
|
491
|
+
marked: "^16.4.1",
|
|
491
492
|
moment: "^2.30.1",
|
|
492
493
|
pbf: "^4.0.1",
|
|
493
494
|
"pretty-error": "^4.0.0",
|
|
494
495
|
pug: "^3.0.3",
|
|
495
|
-
puppeteer: "^24.
|
|
496
|
+
puppeteer: "^24.26.1",
|
|
496
497
|
"sanitize-filename": "^1.6.3",
|
|
497
498
|
"sanitize-html": "^2.17.0",
|
|
498
499
|
sqlstring: "^2.3.3",
|
|
@@ -501,23 +502,24 @@ var package_default = {
|
|
|
501
502
|
yoctocolors: "^2.1.2"
|
|
502
503
|
},
|
|
503
504
|
devDependencies: {
|
|
504
|
-
"@types/archiver": "^
|
|
505
|
-
"@types/
|
|
505
|
+
"@types/archiver": "^7.0.0",
|
|
506
|
+
"@types/cli-table": "^0.3.4",
|
|
507
|
+
"@types/express": "^5.0.4",
|
|
506
508
|
"@types/insane": "^1.0.0",
|
|
507
509
|
"@types/js-beautify": "^1.14.3",
|
|
508
510
|
"@types/lodash-es": "^4.17.12",
|
|
509
511
|
"@types/morgan": "^1.9.10",
|
|
510
|
-
"@types/node": "^
|
|
512
|
+
"@types/node": "^24",
|
|
511
513
|
"@types/pug": "^2.0.10",
|
|
512
514
|
"@types/sanitize-html": "^2.16.0",
|
|
513
515
|
"@types/sqlstring": "^2.3.2",
|
|
514
516
|
"@types/toposort": "^2.0.7",
|
|
515
|
-
"@types/yargs": "^17.0.
|
|
517
|
+
"@types/yargs": "^17.0.34",
|
|
516
518
|
husky: "^9.1.7",
|
|
517
|
-
"lint-staged": "^16.
|
|
519
|
+
"lint-staged": "^16.2.6",
|
|
518
520
|
prettier: "^3.6.2",
|
|
519
521
|
tsup: "^8.5.0",
|
|
520
|
-
typescript: "^5.9.
|
|
522
|
+
typescript: "^5.9.3"
|
|
521
523
|
},
|
|
522
524
|
engines: {
|
|
523
525
|
node: ">= 22"
|
|
@@ -644,9 +646,6 @@ var sortTrips = (trips, config2) => {
|
|
|
644
646
|
const lastStopId = last(longestTripStoptimes).stop_id;
|
|
645
647
|
sortedTrips = sortTripsByStoptimeAtStop(trips, lastStopId);
|
|
646
648
|
}
|
|
647
|
-
if (config2.showDuplicateTrips === false) {
|
|
648
|
-
return deduplicateTrips(sortedTrips ?? []);
|
|
649
|
-
}
|
|
650
649
|
return sortedTrips ?? [];
|
|
651
650
|
};
|
|
652
651
|
var sortTripsByStoptimeAtStop = (trips, stopId) => sortBy(trips, (trip) => {
|
|
@@ -666,7 +665,7 @@ var getCalendarDatesForTimetable = (timetable, config2) => {
|
|
|
666
665
|
const excludedDates = /* @__PURE__ */ new Set();
|
|
667
666
|
const includedDates = /* @__PURE__ */ new Set();
|
|
668
667
|
for (const calendarDate of calendarDates) {
|
|
669
|
-
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(start, end)) {
|
|
668
|
+
if (moment2(calendarDate.date, "YYYYMMDD").isBetween(start, end, "day", "[]")) {
|
|
670
669
|
if (calendarDate.exception_type === 1) {
|
|
671
670
|
includedDates.add(formatDate(calendarDate, config2.dateFormat));
|
|
672
671
|
} else if (calendarDate.exception_type === 2) {
|
|
@@ -1275,7 +1274,7 @@ var addTripContinuation = (trip, timetable) => {
|
|
|
1275
1274
|
trip.continues_as_route = nextTrip;
|
|
1276
1275
|
}
|
|
1277
1276
|
};
|
|
1278
|
-
var filterTrips = (timetable) => {
|
|
1277
|
+
var filterTrips = (timetable, config2) => {
|
|
1279
1278
|
let filteredTrips = timetable.orderedTrips;
|
|
1280
1279
|
for (const trip of filteredTrips) {
|
|
1281
1280
|
const combinedStoptimes = [];
|
|
@@ -1299,6 +1298,9 @@ var filterTrips = (timetable) => {
|
|
|
1299
1298
|
filteredTrips = filteredTrips.filter(
|
|
1300
1299
|
(trip) => trip.stoptimes.length > 1
|
|
1301
1300
|
);
|
|
1301
|
+
if (config2.showDuplicateTrips === false) {
|
|
1302
|
+
filteredTrips = deduplicateTrips(filteredTrips);
|
|
1303
|
+
}
|
|
1302
1304
|
return filteredTrips;
|
|
1303
1305
|
};
|
|
1304
1306
|
var getTripsForTimetable = (timetable, calendars, config2) => {
|
|
@@ -1436,7 +1438,10 @@ var formatTimetables = (timetables, config2) => {
|
|
|
1436
1438
|
if (config2.showMap) {
|
|
1437
1439
|
timetable.geojson = getTimetableGeoJSON(timetable, config2);
|
|
1438
1440
|
}
|
|
1439
|
-
timetable.
|
|
1441
|
+
timetable.trip_ids = uniq(
|
|
1442
|
+
timetable.orderedTrips.map((trip) => trip.trip_id)
|
|
1443
|
+
);
|
|
1444
|
+
timetable.orderedTrips = filterTrips(timetable, config2);
|
|
1440
1445
|
timetable.stops = formatStops(timetable, config2);
|
|
1441
1446
|
return timetable;
|
|
1442
1447
|
});
|
|
@@ -1541,7 +1546,9 @@ var getTimetablePageById = (timetablePageId, config2) => {
|
|
|
1541
1546
|
const timetablePages = getTimetablePages({
|
|
1542
1547
|
timetable_page_id: timetablePageId
|
|
1543
1548
|
});
|
|
1544
|
-
const timetables = mergeTimetablesWithSameId(
|
|
1549
|
+
const timetables = mergeTimetablesWithSameId(
|
|
1550
|
+
getTimetables()
|
|
1551
|
+
);
|
|
1545
1552
|
if (timetablePages.length > 1) {
|
|
1546
1553
|
throw new Error(
|
|
1547
1554
|
`Multiple timetable_pages found for timetable_page_id=${timetablePageId}`
|
|
@@ -1682,6 +1689,7 @@ function setDefaultConfig(initialConfig) {
|
|
|
1682
1689
|
noHead: false,
|
|
1683
1690
|
noPickupSymbol: "**",
|
|
1684
1691
|
noPickupText: "No pickup available",
|
|
1692
|
+
noRegularServiceDaysText: "No regular service days",
|
|
1685
1693
|
noServiceSymbol: "-",
|
|
1686
1694
|
noServiceText: "No service at this stop",
|
|
1687
1695
|
outputFormat: "html",
|
|
@@ -1926,7 +1934,7 @@ function formatDays(calendar, config2) {
|
|
|
1926
1934
|
}
|
|
1927
1935
|
}
|
|
1928
1936
|
if (dayString.length === 0) {
|
|
1929
|
-
dayString =
|
|
1937
|
+
dayString = config2.noRegularServiceDaysText;
|
|
1930
1938
|
}
|
|
1931
1939
|
return dayString;
|
|
1932
1940
|
}
|