minotor 7.0.1 → 7.0.2

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.
@@ -22,18 +22,6 @@ PERFORMANCE OF THIS SOFTWARE.
22
22
  /* global Reflect, Promise, SuppressedError, Symbol, Iterator */
23
23
 
24
24
 
25
- function __rest(s, e) {
26
- var t = {};
27
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
28
- t[p] = s[p];
29
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
30
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
31
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
32
- t[p[i]] = s[p[i]];
33
- }
34
- return t;
35
- }
36
-
37
25
  function __awaiter(thisArg, _arguments, P, generator) {
38
26
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
39
27
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -12782,9 +12770,16 @@ class Time {
12782
12770
  if (times.length === 0) {
12783
12771
  throw new Error('At least one Time instance is required.');
12784
12772
  }
12785
- return times.reduce((maxTime, currentTime) => {
12786
- return currentTime.isAfter(maxTime) ? currentTime : maxTime;
12787
- });
12773
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12774
+ let maxTime = times[0];
12775
+ for (let i = 1; i < times.length; i++) {
12776
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12777
+ if (times[i].minutesSinceMidnight > maxTime.minutesSinceMidnight) {
12778
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12779
+ maxTime = times[i];
12780
+ }
12781
+ }
12782
+ return maxTime;
12788
12783
  }
12789
12784
  /**
12790
12785
  * Computes the minimum Time instance among the provided Time instances.
@@ -12796,9 +12791,16 @@ class Time {
12796
12791
  if (times.length === 0) {
12797
12792
  throw new Error('At least one Time instance is required.');
12798
12793
  }
12799
- return times.reduce((minTime, currentTime) => {
12800
- return currentTime.isBefore(minTime) ? currentTime : minTime;
12801
- });
12794
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12795
+ let minTime = times[0];
12796
+ for (let i = 1; i < times.length; i++) {
12797
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12798
+ if (times[i].minutesSinceMidnight < minTime.minutesSinceMidnight) {
12799
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
12800
+ minTime = times[i];
12801
+ }
12802
+ }
12803
+ return minTime;
12802
12804
  }
12803
12805
  /**
12804
12806
  * Determines if the current Time instance is after another Time instance.
@@ -12807,7 +12809,7 @@ class Time {
12807
12809
  * @returns True if the current Time instance is after the other Time instance, otherwise false.
12808
12810
  */
12809
12811
  isAfter(otherTime) {
12810
- return this.minutesSinceMidnight > otherTime.toMinutes();
12812
+ return this.minutesSinceMidnight > otherTime.minutesSinceMidnight;
12811
12813
  }
12812
12814
  /**
12813
12815
  * Determines if the current Time instance is before another Time instance.
@@ -12816,7 +12818,7 @@ class Time {
12816
12818
  * @returns True if the current Time instance is before the other Time instance, otherwise false.
12817
12819
  */
12818
12820
  isBefore(otherTime) {
12819
- return this.minutesSinceMidnight < otherTime.toMinutes();
12821
+ return this.minutesSinceMidnight < otherTime.minutesSinceMidnight;
12820
12822
  }
12821
12823
  /**
12822
12824
  * Determines if the current Time instance is equal to another Time instance.
@@ -12825,7 +12827,7 @@ class Time {
12825
12827
  * @returns True if the current Time instance is equal to the other Time instance, otherwise false.
12826
12828
  */
12827
12829
  equals(otherTime) {
12828
- return this.minutesSinceMidnight === otherTime.toMinutes();
12830
+ return this.minutesSinceMidnight === otherTime.minutesSinceMidnight;
12829
12831
  }
12830
12832
  }
12831
12833
 
@@ -13265,6 +13267,7 @@ const serializeRouteType = (type) => {
13265
13267
  }
13266
13268
  };
13267
13269
 
13270
+ /* eslint-disable @typescript-eslint/no-non-null-assertion */
13268
13271
  const ALL_TRANSPORT_MODES = new Set([
13269
13272
  'TRAM',
13270
13273
  'SUBWAY',
@@ -13369,9 +13372,7 @@ class Timetable {
13369
13372
  if (!serviceRoute) {
13370
13373
  throw new Error(`Service route not found for route ID: ${route.serviceRoute()}`);
13371
13374
  }
13372
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
13373
- const { routes } = serviceRoute, serviceRouteInfo = __rest(serviceRoute, ["routes"]);
13374
- return serviceRouteInfo;
13375
+ return { type: serviceRoute.type, name: serviceRoute.name };
13375
13376
  }
13376
13377
  /**
13377
13378
  * Finds all routes passing through a stop.