@turf/line-to-polygon
Advanced tools
Comparing version 7.1.0 to 7.2.0
@@ -7,3 +7,3 @@ import * as geojson from 'geojson'; | ||
* | ||
* @name lineToPolygon | ||
* @function | ||
* @param {FeatureCollection|Feature<LineString|MultiLineString>} lines Features to convert | ||
@@ -10,0 +10,0 @@ * @param {Object} [options={}] Optional parameters |
@@ -33,8 +33,6 @@ // index.ts | ||
var type = geom.type; | ||
if (!coords.length) | ||
throw new Error("line must contain coordinates"); | ||
if (!coords.length) throw new Error("line must contain coordinates"); | ||
switch (type) { | ||
case "LineString": | ||
if (autoComplete) | ||
coords = autoCompleteCoords(coords); | ||
if (autoComplete) coords = autoCompleteCoords(coords); | ||
return polygon([coords], properties); | ||
@@ -45,4 +43,3 @@ case "MultiLineString": | ||
coords.forEach(function(coord) { | ||
if (autoComplete) | ||
coord = autoCompleteCoords(coord); | ||
if (autoComplete) coord = autoCompleteCoords(coord); | ||
if (orderCoords) { | ||
@@ -53,4 +50,3 @@ var area = calculateArea(turfBBox(lineString(coord))); | ||
largestArea = area; | ||
} else | ||
multiCoords.push(coord); | ||
} else multiCoords.push(coord); | ||
} else { | ||
@@ -57,0 +53,0 @@ multiCoords.push(coord); |
{ | ||
"name": "@turf/line-to-polygon", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "turf line-to-polygon module", | ||
@@ -60,21 +60,21 @@ "author": "Turf Authors", | ||
"@types/benchmark": "^2.1.5", | ||
"@types/tape": "^4.2.32", | ||
"@types/tape": "^4.13.4", | ||
"benchmark": "^2.1.4", | ||
"load-json-file": "^7.0.1", | ||
"npm-run-all": "^4.1.5", | ||
"tape": "^5.7.2", | ||
"tsup": "^8.0.1", | ||
"tsx": "^4.6.2", | ||
"typescript": "^5.2.2", | ||
"tape": "^5.9.0", | ||
"tsup": "^8.3.5", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.5.4", | ||
"write-json-file": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"@turf/bbox": "^7.1.0", | ||
"@turf/clone": "^7.1.0", | ||
"@turf/helpers": "^7.1.0", | ||
"@turf/invariant": "^7.1.0", | ||
"@turf/bbox": "^7.2.0", | ||
"@turf/clone": "^7.2.0", | ||
"@turf/helpers": "^7.2.0", | ||
"@turf/invariant": "^7.2.0", | ||
"@types/geojson": "^7946.0.10", | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.8.1" | ||
}, | ||
"gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef" | ||
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
29426
191
Updated@turf/bbox@^7.2.0
Updated@turf/clone@^7.2.0
Updated@turf/helpers@^7.2.0
Updated@turf/invariant@^7.2.0
Updatedtslib@^2.8.1