New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/line-to-polygon

Package Overview
Dependencies
Maintainers
7
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/line-to-polygon - npm Package Compare versions

Comparing version 6.5.0 to 7.0.0-alpha.0

5

dist/es/index.js
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

6

dist/js/index.d.ts

@@ -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]&lt;([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]&lt;([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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc