koopjs / koop

Transform, query, and download geospatial data on the web.
http://koopjs.github.io
Other
651 stars 125 forks source link

fix: remove arity validation for provider transforms #985

Closed rgwozdz closed 2 months ago

rgwozdz commented 2 months ago

Provider registration allows for the before and after options; these are functions that can be used to transform the incoming request before it arrives at the getData method or transform the geojson after it is passed out of the getData method. When originally implemented these methods had to use callback form and they were invalid unless they had two (before function ) and three (after function) arguments. Callback was the last argument for each of course. However, we now allow the use of async and as a result it would be valid if the before function had one arg, and the after had two. This PR removes argument length validation from these function as it doesn't seem worth the complexity.

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: 05de23ec8a89970ada86931f192b2d9298d789b2

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | @koopjs/koop-core | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

github-actions[bot] commented 2 months ago

Coverage Report (change vs master)

File Path Statements Branches Functions Lines
packages/core/src/data-provider/index.js 100 green vs 100 green 100 green vs 100 green 100 green vs 100 green 100 green vs 100 green