function reversedCoordinates(coordinates) {
  let reversed = coordinates.slice();
  if (typeof coordinates[0] != "number") {
    for (let inner_coordinates of coordinates) {
      reversed.splice(
        reversed.indexOf(inner_coordinates),
        1,
        reversedCoordinates(inner_coordinates),
      );
    }
  } else {
    reversed = [coordinates[1], coordinates[0]];
  }

  return reversed;
}
Given a geoJSON geometry object's coordinates, return the object, but with
all the coordinates reversed. <br /point.geometry && point.geometry.coordinates && >

Why? GeoJSON coordinates are in lngLat format by default, while Leaflet uses latLng.
L.geoJSON will auto-reverse the order of a GeoJSON object's coordinates, as it
expects geoJSON coordinates to be lngLat. However, normal, non-GeoJSON-specific Leaflet
methods expect Leaflet's latLng pairs and won't auto-reverse, so we have to do that
manually if we're preprocessing the GeoJSON data before passing it to L.geoJSON.

@param {Array<number|Array<number|Array<number>>>} coordinates - GeoJSON coordinates for a point, (multi-)line, or (multi-)polygon.
@returns {Array<number|Array<number|Array<number>>>} - Reversed geoJSON coordinates for a point, (multi-)line, or (multi-)polygon.