New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@turf/collect

Package Overview
Dependencies
Maintainers
4
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/collect - npm Package Compare versions

Comparing version 5.1.5 to 6.0.0

index.ts

25

index.js

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

import turfbbox from '@turf/bbox';
import booleanPointInPolygon from '@turf/boolean-point-in-polygon';
import rbush from 'rbush';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var bbox_1 = require("@turf/bbox");
var boolean_point_in_polygon_1 = require("@turf/boolean-point-in-polygon");
var rbush_1 = require("rbush");
/**

@@ -36,4 +37,3 @@ * Merges a specified property from a FeatureCollection of points into a

function collect(polygons, points, inProperty, outProperty) {
var rtree = rbush(6);
var rtree = rbush_1.default(6);
var treeItems = points.features.map(function (item) {

@@ -48,24 +48,19 @@ return {

});
rtree.load(treeItems);
polygons.features.forEach(function (poly) {
if (!poly.properties) {
poly.properties = {};
}
var bbox = turfbbox(poly);
var potentialPoints = rtree.search({minX: bbox[0], minY: bbox[1], maxX: bbox[2], maxY: bbox[3]});
var bbox = bbox_1.default(poly);
var potentialPoints = rtree.search({ minX: bbox[0], minY: bbox[1], maxX: bbox[2], maxY: bbox[3] });
var values = [];
potentialPoints.forEach(function (pt) {
if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {
if (boolean_point_in_polygon_1.default([pt.minX, pt.minY], poly)) {
values.push(pt.property);
}
});
poly.properties[outProperty] = values;
});
return polygons;
}
export default collect;
exports.default = collect;

33

package.json
{
"name": "@turf/collect",
"version": "5.1.5",
"version": "6.0.0",
"description": "turf collect module",
"main": "main.js",
"module": "main.es.js",
"types": "index.d.ts",
"main": "index",
"files": [
"index.js",
"index.d.ts",
"main.js",
"main.es.js"
"index.ts"
],
"scripts": {
"pretest": "rollup -c ../../rollup.config.js",
"test": "node -r @std/esm test.js",
"posttest": "node -r @std/esm ../../scripts/validate-es5-dependencies.js",
"bench": "node -r @std/esm bench.js",
"prepare": "tsc",
"pretest": "tsc",
"test": "node test.js",
"bench": "node bench.js",
"docs": "node ../../scripts/generate-readmes"

@@ -43,17 +39,12 @@ },

"devDependencies": {
"@std/esm": "*",
"benchmark": "*",
"rollup": "*",
"typescript": "*",
"tape": "*"
},
"dependencies": {
"@turf/bbox": "^5.1.5",
"@turf/boolean-point-in-polygon": "^5.1.5",
"@turf/helpers": "^5.1.5",
"rbush": "^2.0.1"
},
"@std/esm": {
"esm": "js",
"cjs": true
"@turf/bbox": "6.x",
"@turf/boolean-point-in-polygon": "6.x",
"@turf/helpers": "6.x",
"rbush": "2.x"
}
}
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