minotor 8.0.0 → 9.0.0

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +4 -4
  2. package/README.md +1 -1
  3. package/dist/cli.mjs +835 -816
  4. package/dist/cli.mjs.map +1 -1
  5. package/dist/gtfs/transfers.d.ts +21 -6
  6. package/dist/gtfs/trips.d.ts +2 -2
  7. package/dist/parser.cjs.js +666 -642
  8. package/dist/parser.cjs.js.map +1 -1
  9. package/dist/parser.esm.js +666 -642
  10. package/dist/parser.esm.js.map +1 -1
  11. package/dist/router.cjs.js +1 -1
  12. package/dist/router.cjs.js.map +1 -1
  13. package/dist/router.esm.js +1 -1
  14. package/dist/router.esm.js.map +1 -1
  15. package/dist/router.umd.js +1 -1
  16. package/dist/router.umd.js.map +1 -1
  17. package/dist/routing/router.d.ts +4 -4
  18. package/dist/timetable/io.d.ts +3 -3
  19. package/dist/timetable/proto/timetable.d.ts +6 -4
  20. package/dist/timetable/route.d.ts +13 -21
  21. package/dist/timetable/timetable.d.ts +13 -11
  22. package/dist/timetable/tripBoardingId.d.ts +34 -0
  23. package/package.json +1 -1
  24. package/src/__e2e__/timetable/timetable.bin +2 -2
  25. package/src/cli/repl.ts +53 -67
  26. package/src/gtfs/__tests__/parser.test.ts +19 -4
  27. package/src/gtfs/__tests__/transfers.test.ts +598 -318
  28. package/src/gtfs/__tests__/trips.test.ts +3 -44
  29. package/src/gtfs/parser.ts +26 -8
  30. package/src/gtfs/transfers.ts +151 -20
  31. package/src/gtfs/trips.ts +1 -39
  32. package/src/routing/__tests__/result.test.ts +10 -10
  33. package/src/routing/__tests__/router.test.ts +11 -9
  34. package/src/routing/result.ts +2 -2
  35. package/src/routing/router.ts +34 -22
  36. package/src/timetable/__tests__/io.test.ts +8 -7
  37. package/src/timetable/__tests__/route.test.ts +66 -80
  38. package/src/timetable/__tests__/timetable.test.ts +32 -29
  39. package/src/timetable/__tests__/tripBoardingId.test.ts +57 -0
  40. package/src/timetable/io.ts +21 -20
  41. package/src/timetable/proto/timetable.proto +6 -4
  42. package/src/timetable/proto/timetable.ts +84 -48
  43. package/src/timetable/route.ts +39 -56
  44. package/src/timetable/timetable.ts +37 -26
  45. package/src/timetable/tripBoardingId.ts +94 -0
  46. package/tsconfig.json +2 -2
  47. package/dist/timetable/tripId.d.ts +0 -15
  48. package/src/timetable/__tests__/tripId.test.ts +0 -27
  49. package/src/timetable/tripId.ts +0 -29
  50. /package/dist/timetable/__tests__/{tripId.test.d.ts → tripBoardingId.test.d.ts} +0 -0
@@ -0,0 +1,57 @@
1
+ import assert from 'node:assert';
2
+ import { describe, it } from 'node:test';
3
+
4
+ import { RouteId, StopRouteIndex, TripRouteIndex } from '../route.js';
5
+ import {
6
+ decode,
7
+ encode,
8
+ getRouteId,
9
+ getStopIndex,
10
+ getTripIndex,
11
+ } from '../tripBoardingId.js';
12
+
13
+ describe('tripBoardingId', () => {
14
+ it('should maintain identity for encode/decode round-trip', () => {
15
+ const testCases: [StopRouteIndex, RouteId, TripRouteIndex][] = [
16
+ [0, 0, 0],
17
+ [1, 1, 1],
18
+ [500, 1000, 500],
19
+ [100000, 200000, 300000],
20
+ [0, 1048575, 0],
21
+ [1048575, 0, 1048575],
22
+ [1048575, 1048575, 1048575], // Maximum values (2^20 - 1)
23
+ ];
24
+
25
+ testCases.forEach(([stopIndex, routeId, tripIndex]) => {
26
+ const tripBoardingId = encode(stopIndex, routeId, tripIndex);
27
+ const [decodedStopIndex, decodedRouteId, decodedTripIndex] =
28
+ decode(tripBoardingId);
29
+
30
+ assert.strictEqual(decodedStopIndex, stopIndex);
31
+ assert.strictEqual(decodedRouteId, routeId);
32
+ assert.strictEqual(decodedTripIndex, tripIndex);
33
+ });
34
+ });
35
+
36
+ it('should extract stop index correctly', () => {
37
+ const tripBoardingId = encode(42, 100, 200);
38
+ assert.strictEqual(getStopIndex(tripBoardingId), 42);
39
+ });
40
+
41
+ it('should extract route ID correctly', () => {
42
+ const tripBoardingId = encode(42, 100, 200);
43
+ assert.strictEqual(getRouteId(tripBoardingId), 100);
44
+ });
45
+
46
+ it('should extract trip index correctly', () => {
47
+ const tripBoardingId = encode(42, 100, 200);
48
+ assert.strictEqual(getTripIndex(tripBoardingId), 200);
49
+ });
50
+
51
+ it('should throw error for values exceeding 20-bit limit', () => {
52
+ const maxValue = 1048575; // 2^20 - 1
53
+ assert.throws(() => encode(maxValue + 1, 0, 0));
54
+ assert.throws(() => encode(0, maxValue + 1, 0));
55
+ assert.throws(() => encode(0, 0, maxValue + 1));
56
+ });
57
+ });
@@ -16,7 +16,9 @@ import {
16
16
  Transfer,
17
17
  TransferType,
18
18
  TripBoarding,
19
+ TripContinuations,
19
20
  } from './timetable.js';
21
+ import { decode, encode, TripBoardingId } from './tripBoardingId.js';
20
22
 
21
23
  export type SerializedRoute = {
22
24
  stopTimes: Uint16Array;
@@ -137,9 +139,6 @@ export const serializeStopsAdjacency = (
137
139
  }))
138
140
  : [],
139
141
  routes: value.routes,
140
- tripContinuations: value.tripContinuations
141
- ? serializeTripContinuations(value.tripContinuations)
142
- : [],
143
142
  };
144
143
  });
145
144
  };
@@ -205,13 +204,6 @@ export const deserializeStopsAdjacency = (
205
204
  stopAdjacency.transfers = transfers;
206
205
  }
207
206
 
208
- const deserializedTripContinuations = deserializeTripContinuations(
209
- value.tripContinuations,
210
- );
211
- if (deserializedTripContinuations.size > 0) {
212
- stopAdjacency.tripContinuations = deserializedTripContinuations;
213
- }
214
-
215
207
  result.push(stopAdjacency);
216
208
  }
217
209
 
@@ -341,15 +333,19 @@ const serializeRouteType = (type: RouteType): ProtoRouteType => {
341
333
  };
342
334
 
343
335
  export const serializeTripContinuations = (
344
- tripContinuations: Map<number, TripBoarding[]>,
336
+ tripContinuations: TripContinuations,
345
337
  ): ProtoTripContinuationEntry[] => {
346
338
  const result: ProtoTripContinuationEntry[] = [];
339
+ for (const [tripBoardingId, boardings] of tripContinuations.entries()) {
340
+ const [originStopIndex, originRouteId, originTripIndex] =
341
+ decode(tripBoardingId);
347
342
 
348
- for (const [key, value] of tripContinuations.entries()) {
349
343
  result.push({
350
- key: key,
351
- value: value.map((tripBoarding) => ({
352
- hopOnStop: tripBoarding.hopOnStop,
344
+ originStopIndex,
345
+ originRouteId,
346
+ originTripIndex,
347
+ continuations: boardings.map((tripBoarding) => ({
348
+ hopOnStopIndex: tripBoarding.hopOnStopIndex,
353
349
  routeId: tripBoarding.routeId,
354
350
  tripIndex: tripBoarding.tripIndex,
355
351
  })),
@@ -361,21 +357,26 @@ export const serializeTripContinuations = (
361
357
 
362
358
  export const deserializeTripContinuations = (
363
359
  protoTripContinuations: ProtoTripContinuationEntry[],
364
- ): Map<number, TripBoarding[]> => {
365
- const result = new Map<number, TripBoarding[]>();
360
+ ): TripContinuations => {
361
+ const result = new Map<TripBoardingId, TripBoarding[]>();
366
362
 
367
363
  for (let i = 0; i < protoTripContinuations.length; i++) {
368
364
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
369
365
  const entry = protoTripContinuations[i]!;
370
- const tripBoardings: TripBoarding[] = entry.value.map(
366
+ const tripBoardingId = encode(
367
+ entry.originStopIndex,
368
+ entry.originRouteId,
369
+ entry.originTripIndex,
370
+ );
371
+ const tripBoardings: TripBoarding[] = entry.continuations.map(
371
372
  (protoTripBoarding) => ({
372
- hopOnStop: protoTripBoarding.hopOnStop,
373
+ hopOnStopIndex: protoTripBoarding.hopOnStopIndex,
373
374
  routeId: protoTripBoarding.routeId,
374
375
  tripIndex: protoTripBoarding.tripIndex,
375
376
  }),
376
377
  );
377
378
 
378
- result.set(entry.key, tripBoardings);
379
+ result.set(tripBoardingId, tripBoardings);
379
380
  }
380
381
 
381
382
  return result;
@@ -41,20 +41,21 @@ message Transfer {
41
41
  }
42
42
 
43
43
  message TripBoarding {
44
- uint32 hopOnStop = 1;
44
+ uint32 hopOnStopIndex = 1;
45
45
  uint32 routeId = 2;
46
46
  uint32 tripIndex = 3;
47
47
  }
48
48
 
49
49
  message TripContinuationEntry {
50
- uint32 key = 1;
51
- repeated TripBoarding value = 2;
50
+ uint32 originStopIndex = 1;
51
+ uint32 originRouteId = 2;
52
+ uint32 originTripIndex = 3;
53
+ repeated TripBoarding continuations = 4;
52
54
  }
53
55
 
54
56
  message StopAdjacency {
55
57
  repeated uint32 routes = 1;
56
58
  repeated Transfer transfers = 2;
57
- repeated TripContinuationEntry tripContinuations = 3;
58
59
  }
59
60
 
60
61
  enum RouteType {
@@ -81,4 +82,5 @@ message Timetable {
81
82
  repeated StopAdjacency stopsAdjacency = 2;
82
83
  repeated Route routesAdjacency = 3;
83
84
  repeated ServiceRoute serviceRoutes = 4;
85
+ repeated TripContinuationEntry tripContinuations = 5;
84
86
  }
@@ -167,20 +167,21 @@ export interface Transfer {
167
167
  }
168
168
 
169
169
  export interface TripBoarding {
170
- hopOnStop: number;
170
+ hopOnStopIndex: number;
171
171
  routeId: number;
172
172
  tripIndex: number;
173
173
  }
174
174
 
175
175
  export interface TripContinuationEntry {
176
- key: number;
177
- value: TripBoarding[];
176
+ originStopIndex: number;
177
+ originRouteId: number;
178
+ originTripIndex: number;
179
+ continuations: TripBoarding[];
178
180
  }
179
181
 
180
182
  export interface StopAdjacency {
181
183
  routes: number[];
182
184
  transfers: Transfer[];
183
- tripContinuations: TripContinuationEntry[];
184
185
  }
185
186
 
186
187
  export interface ServiceRoute {
@@ -194,6 +195,7 @@ export interface Timetable {
194
195
  stopsAdjacency: StopAdjacency[];
195
196
  routesAdjacency: Route[];
196
197
  serviceRoutes: ServiceRoute[];
198
+ tripContinuations: TripContinuationEntry[];
197
199
  }
198
200
 
199
201
  function createBaseRoute(): Route {
@@ -404,13 +406,13 @@ export const Transfer: MessageFns<Transfer> = {
404
406
  };
405
407
 
406
408
  function createBaseTripBoarding(): TripBoarding {
407
- return { hopOnStop: 0, routeId: 0, tripIndex: 0 };
409
+ return { hopOnStopIndex: 0, routeId: 0, tripIndex: 0 };
408
410
  }
409
411
 
410
412
  export const TripBoarding: MessageFns<TripBoarding> = {
411
413
  encode(message: TripBoarding, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
412
- if (message.hopOnStop !== 0) {
413
- writer.uint32(8).uint32(message.hopOnStop);
414
+ if (message.hopOnStopIndex !== 0) {
415
+ writer.uint32(8).uint32(message.hopOnStopIndex);
414
416
  }
415
417
  if (message.routeId !== 0) {
416
418
  writer.uint32(16).uint32(message.routeId);
@@ -433,7 +435,7 @@ export const TripBoarding: MessageFns<TripBoarding> = {
433
435
  break;
434
436
  }
435
437
 
436
- message.hopOnStop = reader.uint32();
438
+ message.hopOnStopIndex = reader.uint32();
437
439
  continue;
438
440
  }
439
441
  case 2: {
@@ -463,7 +465,7 @@ export const TripBoarding: MessageFns<TripBoarding> = {
463
465
 
464
466
  fromJSON(object: any): TripBoarding {
465
467
  return {
466
- hopOnStop: isSet(object.hopOnStop) ? globalThis.Number(object.hopOnStop) : 0,
468
+ hopOnStopIndex: isSet(object.hopOnStopIndex) ? globalThis.Number(object.hopOnStopIndex) : 0,
467
469
  routeId: isSet(object.routeId) ? globalThis.Number(object.routeId) : 0,
468
470
  tripIndex: isSet(object.tripIndex) ? globalThis.Number(object.tripIndex) : 0,
469
471
  };
@@ -471,8 +473,8 @@ export const TripBoarding: MessageFns<TripBoarding> = {
471
473
 
472
474
  toJSON(message: TripBoarding): unknown {
473
475
  const obj: any = {};
474
- if (message.hopOnStop !== 0) {
475
- obj.hopOnStop = Math.round(message.hopOnStop);
476
+ if (message.hopOnStopIndex !== 0) {
477
+ obj.hopOnStopIndex = Math.round(message.hopOnStopIndex);
476
478
  }
477
479
  if (message.routeId !== 0) {
478
480
  obj.routeId = Math.round(message.routeId);
@@ -488,7 +490,7 @@ export const TripBoarding: MessageFns<TripBoarding> = {
488
490
  },
489
491
  fromPartial<I extends Exact<DeepPartial<TripBoarding>, I>>(object: I): TripBoarding {
490
492
  const message = createBaseTripBoarding();
491
- message.hopOnStop = object.hopOnStop ?? 0;
493
+ message.hopOnStopIndex = object.hopOnStopIndex ?? 0;
492
494
  message.routeId = object.routeId ?? 0;
493
495
  message.tripIndex = object.tripIndex ?? 0;
494
496
  return message;
@@ -496,16 +498,22 @@ export const TripBoarding: MessageFns<TripBoarding> = {
496
498
  };
497
499
 
498
500
  function createBaseTripContinuationEntry(): TripContinuationEntry {
499
- return { key: 0, value: [] };
501
+ return { originStopIndex: 0, originRouteId: 0, originTripIndex: 0, continuations: [] };
500
502
  }
501
503
 
502
504
  export const TripContinuationEntry: MessageFns<TripContinuationEntry> = {
503
505
  encode(message: TripContinuationEntry, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
504
- if (message.key !== 0) {
505
- writer.uint32(8).uint32(message.key);
506
+ if (message.originStopIndex !== 0) {
507
+ writer.uint32(8).uint32(message.originStopIndex);
508
+ }
509
+ if (message.originRouteId !== 0) {
510
+ writer.uint32(16).uint32(message.originRouteId);
511
+ }
512
+ if (message.originTripIndex !== 0) {
513
+ writer.uint32(24).uint32(message.originTripIndex);
506
514
  }
507
- for (const v of message.value) {
508
- TripBoarding.encode(v!, writer.uint32(18).fork()).join();
515
+ for (const v of message.continuations) {
516
+ TripBoarding.encode(v!, writer.uint32(34).fork()).join();
509
517
  }
510
518
  return writer;
511
519
  },
@@ -522,15 +530,31 @@ export const TripContinuationEntry: MessageFns<TripContinuationEntry> = {
522
530
  break;
523
531
  }
524
532
 
525
- message.key = reader.uint32();
533
+ message.originStopIndex = reader.uint32();
526
534
  continue;
527
535
  }
528
536
  case 2: {
529
- if (tag !== 18) {
537
+ if (tag !== 16) {
538
+ break;
539
+ }
540
+
541
+ message.originRouteId = reader.uint32();
542
+ continue;
543
+ }
544
+ case 3: {
545
+ if (tag !== 24) {
546
+ break;
547
+ }
548
+
549
+ message.originTripIndex = reader.uint32();
550
+ continue;
551
+ }
552
+ case 4: {
553
+ if (tag !== 34) {
530
554
  break;
531
555
  }
532
556
 
533
- message.value.push(TripBoarding.decode(reader, reader.uint32()));
557
+ message.continuations.push(TripBoarding.decode(reader, reader.uint32()));
534
558
  continue;
535
559
  }
536
560
  }
@@ -544,18 +568,28 @@ export const TripContinuationEntry: MessageFns<TripContinuationEntry> = {
544
568
 
545
569
  fromJSON(object: any): TripContinuationEntry {
546
570
  return {
547
- key: isSet(object.key) ? globalThis.Number(object.key) : 0,
548
- value: globalThis.Array.isArray(object?.value) ? object.value.map((e: any) => TripBoarding.fromJSON(e)) : [],
571
+ originStopIndex: isSet(object.originStopIndex) ? globalThis.Number(object.originStopIndex) : 0,
572
+ originRouteId: isSet(object.originRouteId) ? globalThis.Number(object.originRouteId) : 0,
573
+ originTripIndex: isSet(object.originTripIndex) ? globalThis.Number(object.originTripIndex) : 0,
574
+ continuations: globalThis.Array.isArray(object?.continuations)
575
+ ? object.continuations.map((e: any) => TripBoarding.fromJSON(e))
576
+ : [],
549
577
  };
550
578
  },
551
579
 
552
580
  toJSON(message: TripContinuationEntry): unknown {
553
581
  const obj: any = {};
554
- if (message.key !== 0) {
555
- obj.key = Math.round(message.key);
582
+ if (message.originStopIndex !== 0) {
583
+ obj.originStopIndex = Math.round(message.originStopIndex);
556
584
  }
557
- if (message.value?.length) {
558
- obj.value = message.value.map((e) => TripBoarding.toJSON(e));
585
+ if (message.originRouteId !== 0) {
586
+ obj.originRouteId = Math.round(message.originRouteId);
587
+ }
588
+ if (message.originTripIndex !== 0) {
589
+ obj.originTripIndex = Math.round(message.originTripIndex);
590
+ }
591
+ if (message.continuations?.length) {
592
+ obj.continuations = message.continuations.map((e) => TripBoarding.toJSON(e));
559
593
  }
560
594
  return obj;
561
595
  },
@@ -565,14 +599,16 @@ export const TripContinuationEntry: MessageFns<TripContinuationEntry> = {
565
599
  },
566
600
  fromPartial<I extends Exact<DeepPartial<TripContinuationEntry>, I>>(object: I): TripContinuationEntry {
567
601
  const message = createBaseTripContinuationEntry();
568
- message.key = object.key ?? 0;
569
- message.value = object.value?.map((e) => TripBoarding.fromPartial(e)) || [];
602
+ message.originStopIndex = object.originStopIndex ?? 0;
603
+ message.originRouteId = object.originRouteId ?? 0;
604
+ message.originTripIndex = object.originTripIndex ?? 0;
605
+ message.continuations = object.continuations?.map((e) => TripBoarding.fromPartial(e)) || [];
570
606
  return message;
571
607
  },
572
608
  };
573
609
 
574
610
  function createBaseStopAdjacency(): StopAdjacency {
575
- return { routes: [], transfers: [], tripContinuations: [] };
611
+ return { routes: [], transfers: [] };
576
612
  }
577
613
 
578
614
  export const StopAdjacency: MessageFns<StopAdjacency> = {
@@ -585,9 +621,6 @@ export const StopAdjacency: MessageFns<StopAdjacency> = {
585
621
  for (const v of message.transfers) {
586
622
  Transfer.encode(v!, writer.uint32(18).fork()).join();
587
623
  }
588
- for (const v of message.tripContinuations) {
589
- TripContinuationEntry.encode(v!, writer.uint32(26).fork()).join();
590
- }
591
624
  return writer;
592
625
  },
593
626
 
@@ -624,14 +657,6 @@ export const StopAdjacency: MessageFns<StopAdjacency> = {
624
657
  message.transfers.push(Transfer.decode(reader, reader.uint32()));
625
658
  continue;
626
659
  }
627
- case 3: {
628
- if (tag !== 26) {
629
- break;
630
- }
631
-
632
- message.tripContinuations.push(TripContinuationEntry.decode(reader, reader.uint32()));
633
- continue;
634
- }
635
660
  }
636
661
  if ((tag & 7) === 4 || tag === 0) {
637
662
  break;
@@ -647,9 +672,6 @@ export const StopAdjacency: MessageFns<StopAdjacency> = {
647
672
  transfers: globalThis.Array.isArray(object?.transfers)
648
673
  ? object.transfers.map((e: any) => Transfer.fromJSON(e))
649
674
  : [],
650
- tripContinuations: globalThis.Array.isArray(object?.tripContinuations)
651
- ? object.tripContinuations.map((e: any) => TripContinuationEntry.fromJSON(e))
652
- : [],
653
675
  };
654
676
  },
655
677
 
@@ -661,9 +683,6 @@ export const StopAdjacency: MessageFns<StopAdjacency> = {
661
683
  if (message.transfers?.length) {
662
684
  obj.transfers = message.transfers.map((e) => Transfer.toJSON(e));
663
685
  }
664
- if (message.tripContinuations?.length) {
665
- obj.tripContinuations = message.tripContinuations.map((e) => TripContinuationEntry.toJSON(e));
666
- }
667
686
  return obj;
668
687
  },
669
688
 
@@ -674,7 +693,6 @@ export const StopAdjacency: MessageFns<StopAdjacency> = {
674
693
  const message = createBaseStopAdjacency();
675
694
  message.routes = object.routes?.map((e) => e) || [];
676
695
  message.transfers = object.transfers?.map((e) => Transfer.fromPartial(e)) || [];
677
- message.tripContinuations = object.tripContinuations?.map((e) => TripContinuationEntry.fromPartial(e)) || [];
678
696
  return message;
679
697
  },
680
698
  };
@@ -784,7 +802,7 @@ export const ServiceRoute: MessageFns<ServiceRoute> = {
784
802
  };
785
803
 
786
804
  function createBaseTimetable(): Timetable {
787
- return { version: "", stopsAdjacency: [], routesAdjacency: [], serviceRoutes: [] };
805
+ return { version: "", stopsAdjacency: [], routesAdjacency: [], serviceRoutes: [], tripContinuations: [] };
788
806
  }
789
807
 
790
808
  export const Timetable: MessageFns<Timetable> = {
@@ -801,6 +819,9 @@ export const Timetable: MessageFns<Timetable> = {
801
819
  for (const v of message.serviceRoutes) {
802
820
  ServiceRoute.encode(v!, writer.uint32(34).fork()).join();
803
821
  }
822
+ for (const v of message.tripContinuations) {
823
+ TripContinuationEntry.encode(v!, writer.uint32(42).fork()).join();
824
+ }
804
825
  return writer;
805
826
  },
806
827
 
@@ -843,6 +864,14 @@ export const Timetable: MessageFns<Timetable> = {
843
864
  message.serviceRoutes.push(ServiceRoute.decode(reader, reader.uint32()));
844
865
  continue;
845
866
  }
867
+ case 5: {
868
+ if (tag !== 42) {
869
+ break;
870
+ }
871
+
872
+ message.tripContinuations.push(TripContinuationEntry.decode(reader, reader.uint32()));
873
+ continue;
874
+ }
846
875
  }
847
876
  if ((tag & 7) === 4 || tag === 0) {
848
877
  break;
@@ -864,6 +893,9 @@ export const Timetable: MessageFns<Timetable> = {
864
893
  serviceRoutes: globalThis.Array.isArray(object?.serviceRoutes)
865
894
  ? object.serviceRoutes.map((e: any) => ServiceRoute.fromJSON(e))
866
895
  : [],
896
+ tripContinuations: globalThis.Array.isArray(object?.tripContinuations)
897
+ ? object.tripContinuations.map((e: any) => TripContinuationEntry.fromJSON(e))
898
+ : [],
867
899
  };
868
900
  },
869
901
 
@@ -881,6 +913,9 @@ export const Timetable: MessageFns<Timetable> = {
881
913
  if (message.serviceRoutes?.length) {
882
914
  obj.serviceRoutes = message.serviceRoutes.map((e) => ServiceRoute.toJSON(e));
883
915
  }
916
+ if (message.tripContinuations?.length) {
917
+ obj.tripContinuations = message.tripContinuations.map((e) => TripContinuationEntry.toJSON(e));
918
+ }
884
919
  return obj;
885
920
  },
886
921
 
@@ -893,6 +928,7 @@ export const Timetable: MessageFns<Timetable> = {
893
928
  message.stopsAdjacency = object.stopsAdjacency?.map((e) => StopAdjacency.fromPartial(e)) || [];
894
929
  message.routesAdjacency = object.routesAdjacency?.map((e) => Route.fromPartial(e)) || [];
895
930
  message.serviceRoutes = object.serviceRoutes?.map((e) => ServiceRoute.fromPartial(e)) || [];
931
+ message.tripContinuations = object.tripContinuations?.map((e) => TripContinuationEntry.fromPartial(e)) || [];
896
932
  return message;
897
933
  },
898
934
  };