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

@turf/mask

Package Overview
Dependencies
Maintainers
0
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/mask - npm Package Compare versions

Comparing version 7.1.0 to 7.2.0

2

dist/esm/index.d.ts

@@ -7,3 +7,3 @@ import { Polygon, MultiPolygon, Feature, FeatureCollection } from 'geojson';

*
* @name mask
* @function
* @param {Polygon|MultiPolygon|Feature<Polygon|MultiPolygon>|FeatureCollection<Polygon|MultiPolygon>} polygon GeoJSON polygon used as interior rings or holes

@@ -10,0 +10,0 @@ * @param {Polygon|Feature<Polygon>} [mask] GeoJSON polygon used as the exterior ring (if undefined, the world extent is used)

// index.ts
import { polygon as createPolygon, multiPolygon } from "@turf/helpers";
import polygonClipping from "polygon-clipping";
import * as polyclip from "polyclip-ts";
import { clone } from "@turf/clone";

@@ -18,7 +18,7 @@ function mask(polygon, mask2, options) {

polygonOuters = createGeomFromPolygonClippingOutput(
polygonClipping.union(polygon.geometry.coordinates)
polyclip.union(polygon.geometry.coordinates)
);
} else {
polygonOuters = createGeomFromPolygonClippingOutput(
polygonClipping.union(polygon.coordinates)
polyclip.union(polygon.coordinates)
);

@@ -32,7 +32,7 @@ }

function unionFc(fc) {
const unioned = fc.features.length === 2 ? polygonClipping.union(
const unioned = fc.features.length === 2 ? polyclip.union(
fc.features[0].geometry.coordinates,
fc.features[1].geometry.coordinates
) : polygonClipping.union.apply(
polygonClipping,
) : polyclip.union.apply(
polyclip,
fc.features.map(function(f) {

@@ -39,0 +39,0 @@ return f.geometry.coordinates;

{
"name": "@turf/mask",
"version": "7.1.0",
"version": "7.2.0",
"description": "turf mask module",

@@ -55,3 +55,3 @@ "author": "Turf Authors",

"@types/benchmark": "^2.1.5",
"@types/tape": "^4.2.32",
"@types/tape": "^4.13.4",
"benchmark": "^2.1.4",

@@ -61,16 +61,16 @@ "load-json-file": "^7.0.1",

"npm-run-all": "^4.1.5",
"tape": "^5.7.2",
"tsup": "^8.0.1",
"tsx": "^4.6.2",
"typescript": "^5.2.2",
"tape": "^5.9.0",
"tsup": "^8.3.5",
"tsx": "^4.19.2",
"typescript": "^5.5.4",
"write-json-file": "^5.0.0"
},
"dependencies": {
"@turf/clone": "^7.1.0",
"@turf/helpers": "^7.1.0",
"@turf/clone": "^7.2.0",
"@turf/helpers": "^7.2.0",
"@types/geojson": "^7946.0.10",
"polygon-clipping": "^0.15.3",
"tslib": "^2.6.2"
"polyclip-ts": "^0.16.8",
"tslib": "^2.8.1"
},
"gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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