@turf/line-to-polygon
Advanced tools
Comparing version 6.5.0 to 7.0.0-alpha.0
import turfBBox from "@turf/bbox"; | ||
import { getCoords, getGeom } from "@turf/invariant"; | ||
import { polygon, multiPolygon, lineString, } from "@turf/helpers"; | ||
import { polygon, multiPolygon, lineString } from "@turf/helpers"; | ||
import clone from "@turf/clone"; | ||
@@ -24,4 +24,3 @@ /** | ||
*/ | ||
function lineToPolygon(lines, options) { | ||
if (options === void 0) { options = {}; } | ||
function lineToPolygon(lines, options = {}) { | ||
var _a, _b, _c; | ||
@@ -28,0 +27,0 @@ // Optional parameters |
@@ -1,2 +0,2 @@ | ||
import { Feature, FeatureCollection, MultiLineString, LineString, Properties } from "@turf/helpers"; | ||
import { Feature, FeatureCollection, MultiLineString, LineString, GeoJsonProperties } from "geojson"; | ||
/** | ||
@@ -22,7 +22,7 @@ * Converts (Multi)LineString(s) to Polygon(s). | ||
declare function lineToPolygon<G extends LineString | MultiLineString>(lines: Feature<G> | FeatureCollection<G> | G, options?: { | ||
properties?: Properties; | ||
properties?: GeoJsonProperties; | ||
autoComplete?: boolean; | ||
orderCoords?: boolean; | ||
mutate?: boolean; | ||
}): Feature<import("@turf/helpers").MultiPolygon, Properties> | Feature<import("@turf/helpers").Polygon, Properties>; | ||
}): Feature<import("geojson").MultiPolygon, GeoJsonProperties> | Feature<import("geojson").Polygon, GeoJsonProperties>; | ||
export default lineToPolygon; |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var bbox_1 = __importDefault(require("@turf/bbox")); | ||
var invariant_1 = require("@turf/invariant"); | ||
var helpers_1 = require("@turf/helpers"); | ||
var clone_1 = __importDefault(require("@turf/clone")); | ||
const tslib_1 = require("tslib"); | ||
const bbox_1 = tslib_1.__importDefault(require("@turf/bbox")); | ||
const invariant_1 = require("@turf/invariant"); | ||
const helpers_1 = require("@turf/helpers"); | ||
const clone_1 = tslib_1.__importDefault(require("@turf/clone")); | ||
/** | ||
@@ -29,4 +27,3 @@ * Converts (Multi)LineString(s) to Polygon(s). | ||
*/ | ||
function lineToPolygon(lines, options) { | ||
if (options === void 0) { options = {}; } | ||
function lineToPolygon(lines, options = {}) { | ||
var _a, _b, _c; | ||
@@ -33,0 +30,0 @@ // Optional parameters |
{ | ||
"name": "@turf/line-to-polygon", | ||
"version": "6.5.0", | ||
"version": "7.0.0-alpha.0", | ||
"description": "turf line-to-polygon module", | ||
@@ -51,3 +51,3 @@ "author": "Turf Authors", | ||
"test:tape": "ts-node -r esm test.js", | ||
"test:types": "tsc --esModuleInterop --noEmit types.ts" | ||
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts" | ||
}, | ||
@@ -66,8 +66,9 @@ "devDependencies": { | ||
"dependencies": { | ||
"@turf/bbox": "^6.5.0", | ||
"@turf/clone": "^6.5.0", | ||
"@turf/helpers": "^6.5.0", | ||
"@turf/invariant": "^6.5.0" | ||
"@turf/bbox": "^7.0.0-alpha.0", | ||
"@turf/clone": "^7.0.0-alpha.0", | ||
"@turf/helpers": "^7.0.0-alpha.0", | ||
"@turf/invariant": "^7.0.0-alpha.0", | ||
"tslib": "^2.3.0" | ||
}, | ||
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e" | ||
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189" | ||
} |
@@ -9,12 +9,14 @@ # @turf/line-to-polygon | ||
**Parameters** | ||
### Parameters | ||
- `lines` **([FeatureCollection][1] \| [Feature][2]<([LineString][3] \| [MultiLineString][4])>)** Features to convert | ||
- `options` **[Object][5]** Optional parameters (optional, default `{}`) | ||
- `options.properties` **[Object][5]** translates GeoJSON properties to Feature (optional, default `{}`) | ||
- `options.autoComplete` **[boolean][6]** auto complete linestrings (matches first & last coordinates) (optional, default `true`) | ||
- `options.orderCoords` **[boolean][6]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`) | ||
* `lines` **([FeatureCollection][1] | [Feature][2]<([LineString][3] | [MultiLineString][4])>)** Features to convert | ||
* `options` **[Object][5]** Optional parameters (optional, default `{}`) | ||
**Examples** | ||
* `options.properties` **[Object][5]** translates GeoJSON properties to Feature (optional, default `{}`) | ||
* `options.autoComplete` **[boolean][6]** auto complete linestrings (matches first & last coordinates) (optional, default `true`) | ||
* `options.orderCoords` **[boolean][6]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`) | ||
* `options.mutate` **[boolean][6]** mutate the original linestring using autoComplete (matches first & last coordinates) (optional, default `false`) | ||
### Examples | ||
```javascript | ||
@@ -29,3 +31,3 @@ var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]); | ||
Returns **[Feature][2]<([Polygon][7] \| [MultiPolygon][8])>** converted to Polygons | ||
Returns **[Feature][2]<([Polygon][7] | [MultiPolygon][8])>** converted to Polygons | ||
@@ -32,0 +34,0 @@ [1]: https://tools.ietf.org/html/rfc7946#section-3.3 |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
16637
72
5
288
1
+ Addedtslib@^2.3.0
+ Added@turf/bbox@7.2.0(transitive)
+ Added@turf/clone@7.2.0(transitive)
+ Added@turf/helpers@7.2.0(transitive)
+ Added@turf/invariant@7.2.0(transitive)
+ Added@turf/meta@7.2.0(transitive)
+ Added@types/geojson@7946.0.16(transitive)
+ Addedtslib@2.8.1(transitive)
- Removed@turf/bbox@6.5.0(transitive)
- Removed@turf/clone@6.5.0(transitive)
- Removed@turf/helpers@6.5.0(transitive)
- Removed@turf/invariant@6.5.0(transitive)
- Removed@turf/meta@6.5.0(transitive)
Updated@turf/bbox@^7.0.0-alpha.0
Updated@turf/clone@^7.0.0-alpha.0
Updated@turf/helpers@^7.0.0-alpha.0