@maptiler/client 3.2.0-rc.3 → 3.2.0

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.
@@ -1412,7 +1412,16 @@ async function directionsPost(body, options = {}) {
1412
1412
  ...fetchExtras,
1413
1413
  method: "POST",
1414
1414
  headers,
1415
- body: JSON.stringify(body)
1415
+ body: JSON.stringify({
1416
+ ...body,
1417
+ // The API rejects locations with unknown fields, let's strip these
1418
+ locations: body.locations.map(({ lon, lat, heading, waypoint }) => ({
1419
+ lon,
1420
+ lat,
1421
+ heading,
1422
+ waypoint
1423
+ }))
1424
+ })
1416
1425
  });
1417
1426
  return await processDirectionsResponse(res);
1418
1427
  }