Socket
Socket
Sign inDemoInstall

@turf/intersect

Package Overview
Dependencies
Maintainers
4
Versions
63
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/intersect - npm Package Compare versions

Comparing version 5.0.6 to 5.1.0

main.mjs

6

main.js

@@ -52,4 +52,4 @@ 'use strict';

// https://github.com/Turfjs/turf/pull/1004
if (cleanCoords(truncate(geom2, {precision: 4})).coordinates[0].length < 4) return null;
if (cleanCoords(truncate(geom1, {precision: 4})).coordinates[0].length < 4) return null;
if (cleanCoords(truncate(geom2, {precision: 4})).coordinates[0].length < 4) { return null; }
if (cleanCoords(truncate(geom1, {precision: 4})).coordinates[0].length < 4) { return null; }

@@ -62,3 +62,3 @@ var reader = new turfJsts.GeoJSONReader();

// https://github.com/Turfjs/turf/issues/951
if (intersection.isEmpty()) return null;
if (intersection.isEmpty()) { return null; }

@@ -65,0 +65,0 @@ var writer = new turfJsts.GeoJSONWriter();

{
"name": "@turf/intersect",
"version": "5.0.6",
"version": "5.1.0",
"description": "turf intersect module",
"main": "main",
"module": "index",
"jsnext:main": "index",
"main": "main.js",
"module": "main.mjs",
"types": "index.d.ts",

@@ -12,3 +11,4 @@ "files": [

"index.d.ts",
"main.js"
"main.js",
"main.mjs"
],

@@ -41,2 +41,3 @@ "scripts": {

"rollup": "*",
"rollup-plugin-buble": "*",
"tape": "*",

@@ -46,6 +47,6 @@ "write-json-file": "*"

"dependencies": {
"@turf/clean-coords": "^5.0.4",
"@turf/helpers": "^5.0.4",
"@turf/invariant": "^5.0.4",
"@turf/truncate": "^5.0.4",
"@turf/clean-coords": "^5.1.0",
"@turf/helpers": "^5.1.0",
"@turf/invariant": "^5.1.0",
"@turf/truncate": "^5.1.0",
"turf-jsts": "*"

@@ -52,0 +53,0 @@ },

@@ -7,8 +7,8 @@ # @turf/intersect

Takes two [polygons](http://geojson.org/geojson-spec.html#polygon) and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined.
Takes two [polygons](https://tools.ietf.org/html/rfc7946#section-3.1.6) and finds their intersection. If they share a border, returns the border; if they don't intersect, returns undefined.
**Parameters**
- `poly1` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Polygon](http://geojson.org/geojson-spec.html#polygon)>** the first polygon
- `poly2` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Polygon](http://geojson.org/geojson-spec.html#polygon)>** the second polygon
- `poly1` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)&lt;[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6)>** the first polygon
- `poly2` **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)&lt;[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6)>** the second polygon

@@ -43,3 +43,3 @@ **Examples**

Returns **([Feature](http://geojson.org/geojson-spec.html#feature-objects) | null)** returns a feature representing the point(s) they share (in case of a [Point](http://geojson.org/geojson-spec.html#point) or [MultiPoint](http://geojson.org/geojson-spec.html#multipoint)), the borders they share (in case of a [LineString](http://geojson.org/geojson-spec.html#linestring) or a [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring)), the area they share (in case of [Polygon](http://geojson.org/geojson-spec.html#polygon) or [MultiPolygon](http://geojson.org/geojson-spec.html#multipolygon)). If they do not share any point, returns `null`.
Returns **([Feature](https://tools.ietf.org/html/rfc7946#section-3.2) | null)** returns a feature representing the point(s) they share (in case of a [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) or [MultiPoint](https://tools.ietf.org/html/rfc7946#section-3.1.3)), the borders they share (in case of a [LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) or a [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5)), the area they share (in case of [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) or [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)). If they do not share any point, returns `null`.

@@ -46,0 +46,0 @@ <!-- This file is automatically generated. Please don't edit it directly:

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