#2973·turf

Increase type strictness of @turf/helper's geometry() coordinates

Author: mfedderlyCreated Dec 16, 2025Updated Sep 13, 2026

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.

bash
export function geometry<
  T extends
    | "Point"
    | "LineString"
    | "Polygon"
    | "MultiPoint"
    | "MultiLineString"
    | "MultiPolygon",
>(
  type: T,
  coordinates: any[],
  _options: Record<string, never> = {}
): {