function wrapX(tileGrid, tileCoord, projection) {
  const z = tileCoord[0];
  const center = tileGrid.getTileCoordCenter(tileCoord);
  const projectionExtent = extentFromProjection(projection);
  if (!containsCoordinate(projectionExtent, center)) {
    const worldWidth = getWidth(projectionExtent);
    const worldsAway = Math.ceil(
      (projectionExtent[0] - center[0]) / worldWidth,
    );
    center[0] += worldWidth * worldsAway;
    return tileGrid.getTileCoordForCoordAndZ(center, z);
  }
  return tileCoord;
}
@param {TileGrid} tileGrid Tile grid.
@param {import("./tilecoord.js").TileCoord} tileCoord Tile coordinate.
@param {import("./proj/Projection.js").default} projection Projection.
@return {import("./tilecoord.js").TileCoord} Tile coordinate.