Transpiled ES5 code to ES6/ES7

This commit is contained in:
Liyas Thomas
2020-06-11 19:55:40 +05:30
parent 9bc0ae975a
commit 0644a8c9fb
16 changed files with 108 additions and 123 deletions

View File

@@ -1,17 +1,15 @@
export function hasPathParams(params) {
return params.some((p) => p.type === "path")
return params.some(({ type }) => type === "path")
}
export function addPathParamsToVariables(params, variables) {
params
.filter(({ key }) => !!key)
.filter(({ type }) => type === "path")
.forEach(p => variables[p.key] = p.value)
return 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")
}
return params.filter(({ key }) => !!key).filter(({ type }) => type != "path")
}