minotor 7.0.0 → 7.0.1
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 -8
- package/dist/cli.mjs +27 -21
- package/dist/cli.mjs.map +1 -1
- package/dist/parser.cjs.js +24 -18
- package/dist/parser.cjs.js.map +1 -1
- package/dist/parser.esm.js +24 -18
- 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/dist/routing/router.d.ts +1 -1
- package/package.json +1 -1
- package/src/routing/router.ts +3 -3
- package/src/timetable/route.ts +23 -22
package/dist/parser.esm.js
CHANGED
|
@@ -13002,29 +13002,35 @@ class Route {
|
|
|
13002
13002
|
* @returns The index of the earliest trip meeting the criteria, or undefined if no such trip is found.
|
|
13003
13003
|
*/
|
|
13004
13004
|
findEarliestTrip(stopId, after = Time.origin(), beforeTrip) {
|
|
13005
|
-
|
|
13006
|
-
? Math.min(beforeTrip - 1, this.nbTrips - 1)
|
|
13007
|
-
: this.nbTrips - 1;
|
|
13008
|
-
if (maxTripIndex < 0) {
|
|
13005
|
+
if (this.nbTrips <= 0)
|
|
13009
13006
|
return undefined;
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13013
|
-
|
|
13014
|
-
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13007
|
+
let hi = this.nbTrips - 1;
|
|
13008
|
+
if (beforeTrip !== undefined)
|
|
13009
|
+
hi = Math.min(hi, beforeTrip - 1);
|
|
13010
|
+
if (hi < 0)
|
|
13011
|
+
return undefined;
|
|
13012
|
+
let lo = 0;
|
|
13013
|
+
let lb = -1;
|
|
13014
|
+
while (lo <= hi) {
|
|
13015
|
+
const mid = (lo + hi) >>> 1;
|
|
13016
|
+
const depMid = this.departureFrom(stopId, mid);
|
|
13017
|
+
if (depMid.isBefore(after)) {
|
|
13018
|
+
lo = mid + 1;
|
|
13022
13019
|
}
|
|
13023
13020
|
else {
|
|
13024
|
-
|
|
13021
|
+
lb = mid;
|
|
13022
|
+
hi = mid - 1;
|
|
13023
|
+
}
|
|
13024
|
+
}
|
|
13025
|
+
if (lb === -1)
|
|
13026
|
+
return undefined;
|
|
13027
|
+
for (let t = lb; t < (beforeTrip !== null && beforeTrip !== void 0 ? beforeTrip : this.nbTrips); t++) {
|
|
13028
|
+
const pickup = this.pickUpTypeFrom(stopId, t);
|
|
13029
|
+
if (pickup !== 'NOT_AVAILABLE') {
|
|
13030
|
+
return t;
|
|
13025
13031
|
}
|
|
13026
13032
|
}
|
|
13027
|
-
return
|
|
13033
|
+
return undefined;
|
|
13028
13034
|
}
|
|
13029
13035
|
/**
|
|
13030
13036
|
* Retrieves the index of a stop within the route.
|