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

@turf/difference

Package Overview
Dependencies
Maintainers
4
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/difference - npm Package Compare versions

Comparing version 4.7.3 to 4.7.4

2

index.d.ts

@@ -6,3 +6,3 @@ /// <reference types="geojson" />

type Input = Feature<Polygon|MultiPolygon> | Polygon | MultiPolygon;
type Output = Feature<Polygon|MultiPolygon> | undefined;
type Output = Feature<Polygon|MultiPolygon> | null;

@@ -9,0 +9,0 @@ /**

@@ -14,3 +14,3 @@ // depend on jsts for now https://github.com/bjornharrtell/jsts/blob/master/examples/overlay.html

* @param {Feature<Polygon|MultiPolygon>} polygon2 Polygon feature to difference from polygon1
* @returns {Feature<Polygon|MultiPolygon>|undefined} a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `undefined`)
* @returns {Feature<Polygon|MultiPolygon>|null} a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `null`)
* @example

@@ -51,3 +51,3 @@ * var polygon1 = turf.polygon([[

geom2 = removeEmptyPolygon(geom2);
if (!geom1) return undefined;
if (!geom1) return null;
if (!geom2) return feature(geom1, properties);

@@ -60,3 +60,3 @@

var differenced = a.difference(b);
if (differenced.isEmpty()) return undefined;
if (differenced.isEmpty()) return null;
var writer = new jsts.io.GeoJSONWriter();

@@ -73,3 +73,3 @@ var geom = writer.write(differenced);

* @param {Geometry<Polygon|MultiPolygon>} geom Geometry Object
* @returns {Geometry<Polygon|MultiPolygon>|undefined} removed any polygons with no areas
* @returns {Geometry<Polygon|MultiPolygon>|null} removed any polygons with no areas
*/

@@ -80,3 +80,3 @@ function removeEmptyPolygon(geom) {

if (area(geom) > 1) return geom;
return undefined;
return null;
case 'MultiPolygon':

@@ -83,0 +83,0 @@ var coordinates = [];

{
"name": "@turf/difference",
"version": "4.7.3",
"version": "4.7.4",
"description": "turf difference module",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -42,3 +42,3 @@ # @turf/difference

Returns **([Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;([Polygon](http://geojson.org/geojson-spec.html#polygon) \| [MultiPolygon](http://geojson.org/geojson-spec.html#multipolygon))> | [undefined](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/undefined))** a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `undefined`)
Returns **([Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;([Polygon](http://geojson.org/geojson-spec.html#polygon) \| [MultiPolygon](http://geojson.org/geojson-spec.html#multipolygon))> | [null](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/null))** a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `null`)

@@ -45,0 +45,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