Skip to content

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

@mfedderly

Description

@mfedderly

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> = {}
): {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions