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

osm-p2p-server

Package Overview
Dependencies
Maintainers
1
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.0.1 to 1.0.2

45

index.js

@@ -7,2 +7,3 @@ var routes = require('routes')

var randombytes = require('randombytes')
var toxml = require('osm-p2p-xml')

@@ -59,41 +60,7 @@ module.exports = Router

r.once('error', function (err) { res.end(err + '\n') })
res.write(h('?xml', { version: '1.0', encoding: 'UTF-8' }, [
h('osm!', [
h('bounds/', {
minlat: q[0][0], maxlat: q[0][1],
minlon: q[1][0], maxlon: q[1][1]
})
])
]))
r.pipe(through.obj(write, end)).pipe(res)
function write (row, enc, next) {
var children = []
;(row.refs || []).forEach(function (ref) {
children.push(h('nd/', { ref: ref }))
})
delete row.refs
Object.keys(row.members || []).forEach(function (ref) {
children.push(h('member/', {
type: 'relation',
ref: ref,
role: ''
}))
})
delete row.members
Object.keys(row.tags || {}).forEach(function (key) {
children.push(h('tag', { k: key, v: row.tags[key] }))
})
delete row.tags
var tag = row.type
delete row.type
next(null, h(tag, row, children))
}
function end (next) {
this.push('</osm>\n')
next()
}
res.setHeader('content-type', 'text/xml; charset=utf-8')
res.setHeader('content-disposition', 'attachment; filename="map.osm"')
res.setHeader('content-encoding', 'identity')
res.setHeader('cache-control', 'no-cache')
r.pipe(toxml(q)).pipe(res)
}

@@ -100,0 +67,0 @@

3

package.json
{
"name": "osm-p2p-server",
"version": "1.0.1",
"version": "1.0.2",
"description": "serve osm http endpoints over a p2p db",

@@ -23,2 +23,3 @@ "main": "index.js",

"inherits": "^2.0.1",
"osm-p2p-xml": "^1.0.0",
"randombytes": "^2.0.1",

@@ -25,0 +26,0 @@ "routes": "^2.1.0",

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