Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

osm-p2p-defork

noffle92ISC1.0.0

convert forking osm-p2p documents into a linear history

osm, osm-p2p, osm-p2p-db, defork, forking

readme

osm-p2p-defork

Convert forking osm-p2p documents into a linear history.

Transforms a list of osm-p2p-db documents into a sublist with a linear (non-forking) history.

Usage

var defork = require('osm-p2p-defork')

osm.query([[-90, 90], [-180, 180]], function (err, docs) {
  docs = defork(docs)
  console.log(docs)
})

outputs the results from the osm.query(), but with a linear history (no forked documents).

API

var defork = require('osm-p2p-defork')

defork(docs)

Consumes a list of OSM documents, formatted as would be returned by osm-p2p-db's query function.

Returns the same documents, but with certain documents filtered to present a linear history.

Timestamps (a timestamp field) should be present on all documents. If they aren't, sorting happens based on the document's version field. This guarantees a non-forking history, but it will not likely be semantically what you want.

Install

With npm installed, run

$ npm install osm-p2p-defork

License

ISC