@turf/line-to-polygon
Advanced tools
Comparing version 6.2.0-alpha.1 to 6.2.0-alpha.2
import turfBBox from '@turf/bbox'; | ||
import { getCoords, getGeom } from '@turf/invariant'; | ||
import { polygon, multiPolygon, lineString } from '@turf/helpers'; | ||
import clone from '@turf/clone'; | ||
/** | ||
@@ -13,2 +14,3 @@ * Converts (Multi)LineString(s) to Polygon(s). | ||
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates | ||
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates) | ||
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons | ||
@@ -29,5 +31,10 @@ * @example | ||
var orderCoords = options.orderCoords; | ||
var mutate = options.mutate; | ||
// default params | ||
autoComplete = (autoComplete !== undefined) ? autoComplete : true; | ||
orderCoords = (orderCoords !== undefined) ? orderCoords : true; | ||
mutate = (mutate !== undefined) ? mutate : false; | ||
if (!mutate) { | ||
lines = clone(lines); | ||
} | ||
switch (lines.type) { | ||
@@ -34,0 +41,0 @@ case 'FeatureCollection': |
@@ -11,2 +11,3 @@ import { Feature, FeatureCollection, MultiLineString, LineString, Polygon, MultiPolygon, Properties } from '@turf/helpers'; | ||
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates | ||
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates) | ||
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons | ||
@@ -25,2 +26,3 @@ * @example | ||
orderCoords?: boolean; | ||
mutate?: boolean; | ||
}): Feature<MultiPolygon, { | ||
@@ -27,0 +29,0 @@ [name: string]: any; |
@@ -9,2 +9,3 @@ "use strict"; | ||
var helpers_1 = require("@turf/helpers"); | ||
var clone_1 = __importDefault(require("@turf/clone")); | ||
/** | ||
@@ -19,2 +20,3 @@ * Converts (Multi)LineString(s) to Polygon(s). | ||
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates | ||
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates) | ||
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons | ||
@@ -35,5 +37,10 @@ * @example | ||
var orderCoords = options.orderCoords; | ||
var mutate = options.mutate; | ||
// default params | ||
autoComplete = (autoComplete !== undefined) ? autoComplete : true; | ||
orderCoords = (orderCoords !== undefined) ? orderCoords : true; | ||
mutate = (mutate !== undefined) ? mutate : false; | ||
if (!mutate) { | ||
lines = clone_1.default(lines); | ||
} | ||
switch (lines.type) { | ||
@@ -40,0 +47,0 @@ case 'FeatureCollection': |
{ | ||
"name": "@turf/line-to-polygon", | ||
"version": "6.2.0-alpha.1", | ||
"version": "6.2.0-alpha.2", | ||
"description": "turf line-to-polygon module", | ||
@@ -50,2 +50,3 @@ "author": "Turf Authors", | ||
"load-json-file": "*", | ||
"npm-run-all": "*", | ||
"tape": "*", | ||
@@ -57,7 +58,8 @@ "tslint": "*", | ||
"dependencies": { | ||
"@turf/bbox": "^6.2.0-alpha.1", | ||
"@turf/helpers": "^6.2.0-alpha.1", | ||
"@turf/invariant": "^6.2.0-alpha.1" | ||
"@turf/bbox": "^6.2.0-alpha.2", | ||
"@turf/clone": "^6.2.0-alpha.2", | ||
"@turf/helpers": "^6.2.0-alpha.2", | ||
"@turf/invariant": "^6.2.0-alpha.2" | ||
}, | ||
"gitHead": "fc519c045a8931c1e14eab9160a7e28391f8da02" | ||
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
16412
294
0
4
8
+ Added@turf/clone@^6.2.0-alpha.2
+ Added@turf/clone@6.5.0(transitive)
Updated@turf/bbox@^6.2.0-alpha.2
Updated@turf/helpers@^6.2.0-alpha.2