From 15f436d7b068c3cda289ddb8cdda3d429147fefb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Donk=C3=B3?= Date: Thu, 13 Jun 2024 12:56:20 +0200 Subject: [PATCH] Simplify unnecessary union type in `turfDistance` --- packages/turf-distance/index.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/turf-distance/index.ts b/packages/turf-distance/index.ts index f6b05a8c6c..3c19e6a2fe 100644 --- a/packages/turf-distance/index.ts +++ b/packages/turf-distance/index.ts @@ -1,4 +1,3 @@ -import { Point } from "geojson"; import { getCoord } from "@turf/invariant"; import { radiansToLength, degreesToRadians, Coord, Units } from "@turf/helpers"; @@ -6,15 +5,15 @@ import { radiansToLength, degreesToRadians, Coord, Units } from "@turf/helpers"; //http://www.movable-type.co.uk/scripts/latlong.html /** - * Calculates the distance between two {@link Point|points} in degrees, radians, miles, or kilometers. + * Calculates the distance between two {@link Coord|coordinates} in degrees, radians, miles, or kilometers. * This uses the [Haversine formula](http://en.wikipedia.org/wiki/Haversine_formula) to account for global curvature. * * @name distance - * @param {Coord | Point} from origin point or coordinate - * @param {Coord | Point} to destination point or coordinate + * @param {Coord} from origin coordinate + * @param {Coord} to destination coordinate * @param {Object} [options={}] Optional parameters * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers - * @returns {number} distance between the two points + * @returns {number} distance between the two coordinates * @example * var from = turf.point([-75.343, 39.984]); * var to = turf.point([-75.534, 39.123]); @@ -28,8 +27,8 @@ import { radiansToLength, degreesToRadians, Coord, Units } from "@turf/helpers"; * to.properties.distance = distance; */ function distance( - from: Coord | Point, - to: Coord | Point, + from: Coord, + to: Coord, options: { units?: Units; } = {}