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

@turf/combine

Package Overview
Dependencies
Maintainers
4
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/combine - npm Package Compare versions

Comparing version 5.1.5 to 6.0.0

index.ts

45

index.js

@@ -1,4 +0,5 @@

import { feature, featureCollection } from '@turf/helpers';
import { featureEach } from '@turf/meta';
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var meta_1 = require("@turf/meta");
/**

@@ -24,7 +25,6 @@ * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features

var groups = {
MultiPoint: {coordinates: [], properties: []},
MultiLineString: {coordinates: [], properties: []},
MultiPolygon: {coordinates: [], properties: []}
MultiPoint: { coordinates: [], properties: [] },
MultiLineString: { coordinates: [], properties: [] },
MultiPolygon: { coordinates: [], properties: [] }
};
var multiMapping = Object.keys(groups).reduce(function (memo, item) {

@@ -34,7 +34,7 @@ memo[item.replace('Multi', '')] = item;

}, {});
function addToGroup(feature, key, multi) {
if (!multi) {
groups[key].coordinates.push(feature.geometry.coordinates);
} else {
}
else {
groups[key].coordinates = groups[key].coordinates.concat(feature.geometry.coordinates);

@@ -44,24 +44,23 @@ }

}
featureEach(fc, function (feature) {
if (!feature.geometry) return;
meta_1.featureEach(fc, function (feature) {
if (!feature.geometry)
return;
if (groups[feature.geometry.type]) {
addToGroup(feature, feature.geometry.type, true);
} else if (multiMapping[feature.geometry.type]) {
}
else if (multiMapping[feature.geometry.type]) {
addToGroup(feature, multiMapping[feature.geometry.type], false);
}
});
return featureCollection(Object.keys(groups)
return helpers_1.featureCollection(Object.keys(groups)
.filter(function (key) {
return groups[key].coordinates.length;
})
return groups[key].coordinates.length;
})
.sort()
.map(function (key) {
var geometry = { type: key, coordinates: groups[key].coordinates };
var properties = { collectedProperties: groups[key].properties };
return feature(geometry, properties);
}));
var geometry = { type: key, coordinates: groups[key].coordinates };
var properties = { collectedProperties: groups[key].properties };
return helpers_1.feature(geometry, properties);
}));
}
export default combine;
exports.default = combine;
{
"name": "@turf/combine",
"version": "5.1.5",
"version": "6.0.0",
"description": "turf combine 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"

@@ -45,4 +41,4 @@ },

"dependencies": {
"@turf/helpers": "^5.1.5",
"@turf/meta": "^5.1.5"
"@turf/helpers": "6.x",
"@turf/meta": "6.x"
},

@@ -49,0 +45,0 @@ "@std/esm": {

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