Isolate Netlify, Firebase and Helper functions + Import from absolute paths

This commit is contained in:
Liyas Thomas
2020-06-21 09:24:45 +05:30
parent 24315ab0e6
commit 5d94ac361e
56 changed files with 108 additions and 112 deletions

15
helpers/requestParams.js Normal file
View File

@@ -0,0 +1,15 @@
export function hasPathParams(params) {
return params.some(({ type }) => type === "path")
}
export function addPathParamsToVariables(params, variables) {
params
.filter(({ key }) => !!key)
.filter(({ type }) => type === "path")
.forEach(({ key, value }) => (variables[key] = value))
return variables
}
export function getQueryParams(params) {
return params.filter(({ key }) => !!key).filter(({ type }) => type != "path")
}