Skip to content

Commit e001b29

Browse files
committedOct 3, 2021
added wrap-func
1 parent fc41d23 commit e001b29

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
 

‎src/wrap-func.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/**
2+
* @prettier
3+
*/
4+
import parse from "./parse";
5+
6+
// this function basically allows you to pass a URL into a geoblaze function
7+
// and let geoblaze parse the GeoRaster for you
8+
export default function wrap(func) {
9+
return (georaster, ...rest) => {
10+
if (typeof georaster === "string") {
11+
return parse(georaster).then(georaster => func(georaster, ...rest));
12+
} else {
13+
return func(georaster, ...rest);
14+
}
15+
};
16+
}

0 commit comments

Comments
 (0)
Please sign in to comment.