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

osm-p2p-server

Package Overview
Dependencies
Maintainers
2
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

osm-p2p-server - npm Package Compare versions

Comparing version 1.6.0 to 1.6.1

14

lib/xml_diff.js

@@ -10,3 +10,3 @@ var parsexml = require('xml-parser')

var ops = { create: [], modify: [], delete: [] }
var ids = {}
var ids = { way: {}, node: {}, relation: {} }
if (xml.root.name !== 'osmChange') return ops

@@ -18,4 +18,6 @@ xml.root.children.forEach(function (c) {

if (doc.id && Number(doc.id) < 0) {
ids[doc.id] = hex2dec(randombytes(8).toString('hex'))
doc.id = ids[doc.oldId]
if (has(ids, ch.name)) {
ids[ch.name][doc.id] = hex2dec(randombytes(8).toString('hex'))
doc.id = ids[ch.name][doc.oldId]
}
}

@@ -51,7 +53,9 @@ if (ch.name === 'way') {

op.refs = op.refs.map(function (ref) {
return has(ids, ref) ? ids[ref] : ref
return has(ids.node, ref) ? ids.node[ref] : ref
})
} else if (op.members) {
op.members.forEach(function (m) {
if (has(ids, m.ref)) m.ref = ids[m.ref]
if (has(ids.node, m.ref)) m.ref = ids.node[m.ref]
if (has(ids.way, m.ref)) m.ref = ids.way[m.ref]
if (has(ids.relation, m.ref)) m.ref = ids.relation[m.ref]
})

@@ -58,0 +62,0 @@ }

{
"name": "osm-p2p-server",
"version": "1.6.0",
"version": "1.6.1",
"description": "serve osm http endpoints over a p2p db",

@@ -5,0 +5,0 @@ "main": "index.js",

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