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

@turf/mask

Package Overview
Dependencies
Maintainers
7
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 6.5.0 to 7.0.0-alpha.0

7

index.d.ts

@@ -1,7 +0,2 @@

import {
Feature,
Polygon,
MultiPolygon,
FeatureCollection,
} from "@turf/helpers";
import { Feature, Polygon, MultiPolygon, FeatureCollection } from "geojson";

@@ -8,0 +3,0 @@ /**

8

package.json
{
"name": "@turf/mask",
"version": "6.5.0",
"version": "7.0.0-alpha.0",
"description": "turf mask module",

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

"test:tape": "node -r esm test.js",
"test:types": "tsc --esModuleInterop --noEmit types.ts"
"test:types": "tsc --esModuleInterop --noEmit --strict types.ts"
},

@@ -58,6 +58,6 @@ "devDependencies": {

"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/helpers": "^7.0.0-alpha.0",
"polygon-clipping": "^0.15.3"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
"gitHead": "0edc4c491b999e5ace770a61e1cf549f7c004189"
}

@@ -9,29 +9,12 @@ # @turf/mask

**Parameters**
### Parameters
- `polygon` **([FeatureCollection][2] \| [Feature][3]<([Polygon][4] \| [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes.
- `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)
* `polygon` **([FeatureCollection][2] | [Feature][3]<([Polygon][4] | [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes.
* `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used)
**Examples**
### Examples
```javascript
var polygon = turf.polygon([
[
[112, -21],
[116, -36],
[146, -39],
[153, -24],
[133, -10],
[112, -21],
],
]);
var mask = turf.polygon([
[
[90, -55],
[170, -55],
[170, 10],
[90, 10],
[90, -55],
],
]);
var polygon = turf.polygon([[[112, -21], [116, -36], [146, -39], [153, -24], [133, -10], [112, -21]]]);
var mask = turf.polygon([[[90, -55], [170, -55], [170, 10], [90, 10], [90, -55]]]);

@@ -41,11 +24,15 @@ var masked = turf.mask(polygon, mask);

//addToMap
var addToMap = [masked];
var addToMap = [masked]
```
Returns **[Feature][3]&lt;[Polygon][4]>** Masked Polygon (exterior ring with holes).
Returns **[Feature][3]<[Polygon][4]>** Masked Polygon (exterior ring with holes).
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[2]: https://tools.ietf.org/html/rfc7946#section-3.3
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7

@@ -52,0 +39,0 @@

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