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