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

fences-slicer

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fences-slicer - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

2

package.json
{
"name": "fences-slicer",
"version": "0.2.3",
"version": "0.2.4",
"description": "Split large geojson file into smaller region files",

@@ -5,0 +5,0 @@ "keywords": [

@@ -14,13 +14,13 @@ var fs = require('fs-extra');

isCountry(data);
data.properties['name:FENCES'] = sanitizeName(data);
dedupe(data);
var cleanName = sanitizeName(data);
dedupe(cleanName);
data = simplify(data, 0.001);
names.push(data.properties['name:FENCES']);
names.push(cleanName);
var copy = {
properties: {
'name': data.properties['name:en'],
'name:FENCES': data.properties['name:FENCES']
'name:display': getName(data),
'name': cleanName
},

@@ -42,3 +42,3 @@ geometry: data.geometry,

stream.on('finish', function () {
console.log('\nAll done!!!\nRegions file generated with ' + names.length + ' regions');
console.log('\nRegions file generated with ' + names.length + ' regions');
});

@@ -48,3 +48,3 @@ };

function sanitizeName(obj) {
var name = obj.properties['name:en']; // || obj.properties['name'];
var name = getName(obj);
var clean = name.replace(/[^a-z0-9]/gi, '_').toLowerCase();

@@ -59,5 +59,9 @@ var check = name.replace(/[_]/gi, '');

function dedupe(obj) {
if (names.indexOf(obj.properties['name:FENCES']) !== -1) {
throw new Error('Duplicate object not added: ' + obj.properties.name);
function getName(obj) {
return obj.properties['name:en'] || obj.properties.name;
}
function dedupe(name) {
if (names.indexOf(name) !== -1) {
throw new Error('Duplicate object not added: ' + name);
}

@@ -64,0 +68,0 @@ }

Sorry, the diff of this file is not supported yet

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