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

turf-filter

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

turf-filter - npm Package Compare versions

Comparing version 0.1.2 to 1.0.0

bench.js

6

index.js

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

var featureCollection = require('turf-featurecollection')
var featureCollection = require('turf-featurecollection');

@@ -7,6 +7,6 @@ module.exports = function(collection, key, val) {

if(collection.features[i].properties[key] === val) {
newFC.features.push(collection.features[i])
newFC.features.push(collection.features[i]);
}
}
return newFC
return newFC;
}
{
"name": "turf-filter",
"version": "0.1.2",
"version": "1.0.0",
"description": "turf filter module",

@@ -25,9 +25,10 @@ "main": "index.js",

"devDependencies": {
"tape": "^2.13.3",
"turf-featurecollection": "^0.1.0",
"turf-point": "^0.1.1"
"benchmark": "^1.0.0",
"tape": "^3.0.3",
"turf-featurecollection": "^1.0.0",
"turf-point": "^1.2.0"
},
"dependencies": {
"turf-featurecollection": "^0.1.0"
"turf-featurecollection": "^1.0.0"
}
}

@@ -1,8 +0,8 @@

var test = require('tape')
var filter = require('./')
var featureCollection = require('turf-featurecollection')
var point = require('turf-point')
var test = require('tape');
var filter = require('./');
var featureCollection = require('turf-featurecollection');
var point = require('turf-point');
test('remove', function(t){
t.plan(2)
t.plan(2);

@@ -15,8 +15,8 @@ var points = featureCollection(

point(2,3, {team: 'Red Sox'}),
point(4,2, {team: 'Yankees'})])
point(4,2, {team: 'Yankees'})]);
newFC = filter(points, 'team', 'Nationals')
newFC = filter(points, 'team', 'Nationals');
t.equal(newFC.features.length, 1, 'should filter all but 1 feature')
t.equal(newFC.features[0].properties.team, 'Nationals', 'feature team property should be Nationals')
t.equal(newFC.features.length, 1, 'should filter all but 1 feature');
t.equal(newFC.features[0].properties.team, 'Nationals', 'feature team property should be Nationals');
});
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