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

@turf/boolean-overlap

Package Overview
Dependencies
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/boolean-overlap - npm Package Compare versions

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

dist/es/package.json

36

dist/es/index.js

@@ -1,6 +0,6 @@

import { segmentEach } from '@turf/meta';
import { getGeom } from '@turf/invariant';
import lineOverlap from '@turf/line-overlap';
import lineIntersect from '@turf/line-intersect';
import GeojsonEquality from 'geojson-equality';
import { segmentEach } from "@turf/meta";
import { getGeom } from "@turf/invariant";
import lineOverlap from "@turf/line-overlap";
import lineIntersect from "@turf/line-intersect";
import GeojsonEquality from "geojson-equality";
/**

@@ -30,9 +30,13 @@ * Compares two geometries of the same dimension and returns true if their intersection set results in a geometry

var type2 = geom2.type;
if ((type1 === 'MultiPoint' && type2 !== 'MultiPoint') ||
((type1 === 'LineString' || type1 === 'MultiLineString') && (type2 !== 'LineString' && type2 !== 'MultiLineString')) ||
((type1 === 'Polygon' || type1 === 'MultiPolygon') && (type2 !== 'Polygon' && type2 !== 'MultiPolygon'))) {
throw new Error('features must be of the same type');
if ((type1 === "MultiPoint" && type2 !== "MultiPoint") ||
((type1 === "LineString" || type1 === "MultiLineString") &&
type2 !== "LineString" &&
type2 !== "MultiLineString") ||
((type1 === "Polygon" || type1 === "MultiPolygon") &&
type2 !== "Polygon" &&
type2 !== "MultiPolygon")) {
throw new Error("features must be of the same type");
}
if (type1 === 'Point')
throw new Error('Point geometry not supported');
if (type1 === "Point")
throw new Error("Point geometry not supported");
// features must be not equal

@@ -44,3 +48,3 @@ var equality = new GeojsonEquality({ precision: 6 });

switch (type1) {
case 'MultiPoint':
case "MultiPoint":
for (var i = 0; i < geom1.coordinates.length; i++) {

@@ -56,4 +60,4 @@ for (var j = 0; j < geom2.coordinates.length; j++) {

return false;
case 'LineString':
case 'MultiLineString':
case "LineString":
case "MultiLineString":
segmentEach(feature1, function (segment1) {

@@ -66,4 +70,4 @@ segmentEach(feature2, function (segment2) {

break;
case 'Polygon':
case 'MultiPolygon':
case "Polygon":
case "MultiPolygon":
segmentEach(feature1, function (segment1) {

@@ -70,0 +74,0 @@ segmentEach(feature2, function (segment2) {

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

import { Feature, Geometry } from '@turf/helpers';
import { Feature, Geometry } from "@turf/helpers";
/**

@@ -3,0 +3,0 @@ * Compares two geometries of the same dimension and returns true if their intersection set results in a geometry

@@ -35,9 +35,13 @@ "use strict";

var type2 = geom2.type;
if ((type1 === 'MultiPoint' && type2 !== 'MultiPoint') ||
((type1 === 'LineString' || type1 === 'MultiLineString') && (type2 !== 'LineString' && type2 !== 'MultiLineString')) ||
((type1 === 'Polygon' || type1 === 'MultiPolygon') && (type2 !== 'Polygon' && type2 !== 'MultiPolygon'))) {
throw new Error('features must be of the same type');
if ((type1 === "MultiPoint" && type2 !== "MultiPoint") ||
((type1 === "LineString" || type1 === "MultiLineString") &&
type2 !== "LineString" &&
type2 !== "MultiLineString") ||
((type1 === "Polygon" || type1 === "MultiPolygon") &&
type2 !== "Polygon" &&
type2 !== "MultiPolygon")) {
throw new Error("features must be of the same type");
}
if (type1 === 'Point')
throw new Error('Point geometry not supported');
if (type1 === "Point")
throw new Error("Point geometry not supported");
// features must be not equal

@@ -49,3 +53,3 @@ var equality = new geojson_equality_1.default({ precision: 6 });

switch (type1) {
case 'MultiPoint':
case "MultiPoint":
for (var i = 0; i < geom1.coordinates.length; i++) {

@@ -61,4 +65,4 @@ for (var j = 0; j < geom2.coordinates.length; j++) {

return false;
case 'LineString':
case 'MultiLineString':
case "LineString":
case "MultiLineString":
meta_1.segmentEach(feature1, function (segment1) {

@@ -71,4 +75,4 @@ meta_1.segmentEach(feature2, function (segment2) {

break;
case 'Polygon':
case 'MultiPolygon':
case "Polygon":
case "MultiPolygon":
meta_1.segmentEach(feature1, function (segment1) {

@@ -75,0 +79,0 @@ meta_1.segmentEach(feature2, function (segment2) {

{
"name": "@turf/boolean-overlap",
"version": "6.2.0-alpha.2",
"version": "6.2.0-alpha.3",
"description": "turf boolean-overlap module",

@@ -32,2 +32,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",

@@ -39,10 +43,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"
},

@@ -57,2 +60,3 @@ "devDependencies": {

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

@@ -62,10 +66,10 @@ "typescript": "*"

"dependencies": {
"@turf/helpers": "^6.2.0-alpha.2",
"@turf/invariant": "^6.2.0-alpha.2",
"@turf/line-intersect": "^6.2.0-alpha.2",
"@turf/line-overlap": "^6.2.0-alpha.2",
"@turf/meta": "^6.2.0-alpha.2",
"@turf/helpers": "^6.2.0-alpha.3",
"@turf/invariant": "^6.2.0-alpha.3",
"@turf/line-intersect": "^6.2.0-alpha.3",
"@turf/line-overlap": "^6.2.0-alpha.3",
"@turf/meta": "^6.2.0-alpha.3",
"geojson-equality": "0.1.6"
},
"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