minotor 11.1.2 → 11.1.3

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 CHANGED
@@ -1,6 +1,6 @@
1
- ## [11.1.2](https://github.com/aubryio/minotor/compare/v11.1.1...v11.1.2) (2026-04-18)
1
+ ## [11.1.3](https://github.com/aubryio/minotor/compare/v11.1.2...v11.1.3) (2026-04-18)
2
2
 
3
3
 
4
- ### Performance Improvements
4
+ ### Bug Fixes
5
5
 
6
- * easy performance wins with minor refactorings ([#65](https://github.com/aubryio/minotor/issues/65)) ([b3cfc62](https://github.com/aubryio/minotor/commit/b3cfc62b56cd754aff964333f4296301185e2a87))
6
+ * re-expose arrivals iterator ([681ee3a](https://github.com/aubryio/minotor/commit/681ee3a7c131c097734333cd60f5b0eed35cf3bd))
package/dist/cli.mjs CHANGED
@@ -21999,6 +21999,31 @@ class RoutingState {
21999
21999
  this.earliestArrivalTimes[stop] = time;
22000
22000
  this.earliestArrivalLegs[stop] = leg;
22001
22001
  }
22002
+ /**
22003
+ * Iterates over every stop that has been reached, yielding its stop ID,
22004
+ * earliest arrival time, and the number of legs taken to reach it.
22005
+ *
22006
+ * Unreached stops (those still at UNREACHED_TIME) are skipped entirely.
22007
+ *
22008
+ * @example
22009
+ * ```ts
22010
+ * for (const { stop, arrival, legNumber } of routingState.arrivals()) {
22011
+ * console.log(`Stop ${stop}: arrived at ${arrival} after ${legNumber} leg(s)`);
22012
+ * }
22013
+ * ```
22014
+ */
22015
+ *arrivals() {
22016
+ for (let stop = 0; stop < this.earliestArrivalTimes.length; stop++) {
22017
+ const time = this.earliestArrivalTimes[stop];
22018
+ if (time < UNREACHED_TIME) {
22019
+ yield {
22020
+ stop,
22021
+ arrival: time,
22022
+ legNumber: this.earliestArrivalLegs[stop],
22023
+ };
22024
+ }
22025
+ }
22026
+ }
22002
22027
  /**
22003
22028
  * Returns the earliest arrival at a stop as an {@link Arrival} object,
22004
22029
  * or undefined if the stop has not been reached.