Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/polygon-to-line

Package Overview
Dependencies
Maintainers
6
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

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

Comparing version 6.2.0-alpha.2 to 6.2.0-alpha.3

dist/es/package.json

24

dist/es/index.js

@@ -27,5 +27,8 @@ import { featureCollection, lineString, multiLineString } from "@turf/helpers";

switch (geom.type) {
case "Polygon": return polygonToLine(geom, options);
case "MultiPolygon": return multiPolygonToLine(geom, options);
default: throw new Error("invalid poly");
case "Polygon":
return polygonToLine(geom, options);
case "MultiPolygon":
return multiPolygonToLine(geom, options);
default:
throw new Error("invalid poly");
}

@@ -39,5 +42,8 @@ }

var geom = getGeom(poly);
var type = geom.type;
var coords = geom.coordinates;
var properties = options.properties ? options.properties : poly.type === "Feature" ? poly.properties : {};
var properties = options.properties
? options.properties
: poly.type === "Feature"
? poly.properties
: {};
return coordsToLine(coords, properties);

@@ -51,6 +57,8 @@ }

var geom = getGeom(multiPoly);
var type = geom.type;
var coords = geom.coordinates;
var properties = options.properties ? options.properties :
multiPoly.type === "Feature" ? multiPoly.properties : {};
var properties = options.properties
? options.properties
: multiPoly.type === "Feature"
? multiPoly.properties
: {};
var lines = [];

@@ -57,0 +65,0 @@ coords.forEach(function (coord) {

@@ -29,5 +29,8 @@ "use strict";

switch (geom.type) {
case "Polygon": return polygonToLine(geom, options);
case "MultiPolygon": return multiPolygonToLine(geom, options);
default: throw new Error("invalid poly");
case "Polygon":
return polygonToLine(geom, options);
case "MultiPolygon":
return multiPolygonToLine(geom, options);
default:
throw new Error("invalid poly");
}

@@ -42,5 +45,8 @@ }

var geom = invariant_1.getGeom(poly);
var type = geom.type;
var coords = geom.coordinates;
var properties = options.properties ? options.properties : poly.type === "Feature" ? poly.properties : {};
var properties = options.properties
? options.properties
: poly.type === "Feature"
? poly.properties
: {};
return coordsToLine(coords, properties);

@@ -55,6 +61,8 @@ }

var geom = invariant_1.getGeom(multiPoly);
var type = geom.type;
var coords = geom.coordinates;
var properties = options.properties ? options.properties :
multiPoly.type === "Feature" ? multiPoly.properties : {};
var properties = options.properties
? options.properties
: multiPoly.type === "Feature"
? multiPoly.properties
: {};
var lines = [];

@@ -61,0 +69,0 @@ coords.forEach(function (coord) {

{
"name": "@turf/polygon-to-line",
"version": "6.2.0-alpha.2",
"version": "6.2.0-alpha.3",
"description": "turf polygon-to-line module",

@@ -27,2 +27,6 @@ "author": "Turf Authors",

"module": "dist/es/index.js",
"exports": {
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
},
"types": "dist/js/index.d.ts",

@@ -34,10 +38,9 @@ "sideEffects": false,

"scripts": {
"bench": "npm-run-all prepare bench:run",
"bench:run": "node bench.js",
"bench": "ts-node bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"prepare": "npm-run-all prepare:*",
"prepare:es": "tsc --outDir dist/es --module esnext --declaration false",
"prepare:js": "tsc",
"test": "npm-run-all prepare test:*",
"test:tape": "node -r esm test.js"
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js"
},

@@ -50,2 +53,3 @@ "devDependencies": {

"tape": "*",
"ts-node": "*",
"tslint": "*",

@@ -56,6 +60,6 @@ "typescript": "*",

"dependencies": {
"@turf/helpers": "^6.2.0-alpha.2",
"@turf/invariant": "^6.2.0-alpha.2"
"@turf/helpers": "^6.2.0-alpha.3",
"@turf/invariant": "^6.2.0-alpha.3"
},
"gitHead": "23d5cb91d77e0c1e2e903a2252f525797f1d0d09"
"gitHead": "dce9edfc705352e8cb9e0083c9330ba0e8d77409"
}
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