Skip to content

Commit

Permalink
added wrap-func
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Oct 3, 2021
1 parent fc41d23 commit e001b29
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/wrap-func.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* @prettier
*/
import parse from "./parse";

// this function basically allows you to pass a URL into a geoblaze function
// and let geoblaze parse the GeoRaster for you
export default function wrap(func) {
return (georaster, ...rest) => {
if (typeof georaster === "string") {
return parse(georaster).then(georaster => func(georaster, ...rest));
} else {
return func(georaster, ...rest);
}
};
}

0 comments on commit e001b29

Please sign in to comment.