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.
- package/CHANGELOG.md +3 -3
- package/dist/cli.mjs +27 -25
- package/dist/cli.mjs.map +1 -1
- package/dist/parser.cjs.js +25 -24
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +25 -24
- package/dist/parser.esm.js.map +1 -1
- package/dist/router.cjs.js +1 -1
- package/dist/router.cjs.js.map +1 -1
- package/dist/router.esm.js +1 -1
- package/dist/router.esm.js.map +1 -1
- package/dist/router.umd.js +1 -1
- package/dist/router.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/routing/router.ts +5 -3
- package/src/timetable/time.ts +23 -9
- package/src/timetable/timetable.ts +1 -3
package/dist/parser.cjs.js
CHANGED
|
@@ -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
|
-
|
|
12788
|
-
|
|
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
|
-
|
|
12802
|
-
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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.
|