Now that geometry() is being more detailed with its typing of T, we can also make the coordinates arg stricter to enforce that the correct shape gets passed in at TypeScript checking time.
export function geometry<
T extends
| "Point"
| "LineString"
| "Polygon"
| "MultiPoint"
| "MultiLineString"
| "MultiPolygon",
>(
type: T,
coordinates: any[],
_options: Record<string, never> = {}
): {
Now that
geometry()is being more detailed with its typing ofT, we can also make thecoordinatesarg stricter to enforce that the correct shape gets passed in at TypeScript checking time.