@furkot/directions 3.0.1 → 3.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.
@@ -47,7 +47,7 @@ function extractSegment(result, { distance, index, narrative, time }) {
47
47
  segments.push({
48
48
  duration: time,
49
49
  distance: Math.round((distance || 0) * unitMultiplier),
50
- path: indexes && path && path.slice(indexes[index], indexes[index + 1]),
50
+ path: indexes && path?.slice(indexes[index], indexes[index + 1]),
51
51
  instructions: narrative
52
52
  });
53
53
  return result;
@@ -27,6 +27,7 @@ const turnDistance = 100; // don't adjust speed of turns
27
27
  const maxRoundabout = 12 * 60 * 60; // 12 hours maximum for route that is 10 times longer than direct distance
28
28
 
29
29
  const maneuver = {
30
+ start: 1,
30
31
  ferryEnter: 28,
31
32
  ferryExit: 29
32
33
  };
@@ -42,7 +43,7 @@ function prepareWaypoint(p) {
42
43
 
43
44
  function extractSegment(
44
45
  result,
45
- { type, begin_shape_index, end_shape_index, instruction, length, time, rough, toll, travel_mode }
46
+ { type, begin_shape_index, end_shape_index, ferry, instruction, length, time, rough, toll, travel_mode }
46
47
  ) {
47
48
  const {
48
49
  directions: { segments, routes },
@@ -82,7 +83,7 @@ function extractSegment(
82
83
  util.last(segments).mode = travelMode.ferry;
83
84
  util.last(routes).ferry = true;
84
85
  }
85
- } else if (type === maneuver.ferryEnter) {
86
+ } else if (type === maneuver.ferryEnter || (type === maneuver.start && ferry)) {
86
87
  seg.mode = travelMode.ferry;
87
88
  result.ferry = util.last(routes).ferry = true;
88
89
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@furkot/directions",
3
- "version": "3.0.1",
3
+ "version": "3.0.2",
4
4
  "description": "Directions service for Furkot",
5
5
  "author": {
6
6
  "name": "Damian Krzeminski",
@@ -28,7 +28,7 @@
28
28
  "vis-why": "~2"
29
29
  },
30
30
  "devDependencies": {
31
- "@biomejs/biome": "^2.3.13"
31
+ "@biomejs/biome": "2.3.13"
32
32
  },
33
33
  "scripts": {
34
34
  "test": "make check"