function extentFromProjection(projection) {
  projection = getProjection(projection);
  let extent = projection.getExtent();
  if (!extent) {
    const half =
      (180 * METERS_PER_UNIT.degrees) / projection.getMetersPerUnit();
    extent = createOrUpdate(-half, -half, half, half);
  }
  return extent;
}
Generate a tile grid extent from a projection.  If the projection has an
extent, it is used.  If not, a global extent is assumed.
@param {import("./proj.js").ProjectionLike} projection Projection.
@return {import("./extent.js").Extent} Extent.