Use @osmcha/osmchange-parser and @osmcha/osm-changeset-xml-parser; remove lib/xml.js #21
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wrote two new helper modules recently, osmchange-parser and osm-changeset-xml-parser. They both use saxjs, so they work in the browser and in Node, and like v2.0.0 of osm-adiff-parser they are written as ES6 modules and transpiled to CommonJS at publish time, so you can
require
orimport
them, whichever your project uses. They also both have unit tests. Code review on these repos is totally welcome if you're inclined. 🙂Anyway, this PR pulls in those two modules as new dependencies and removes
lib/xml.js
which implemented similar functionality. It also drops thehtmlparser2
dependency which is no longer required.I tested carefully to make sure that the osm-adiff-service produces identical output before and after this change. The new function
makeBackwardsCompatible
inlib/get-changesets.js
does some type conversion and other reshaping of the output data in order to ensure this. We might want to think about creating a formal spec for thereal-changeset
schema in the future, but for now I'm assuming any change might break existing consumers and should therefore be avoided.