* feat: toggler for parameters and headers * refactor: move bodyParams to separate component + feat: input toggle * fix: backward copaitability * Fixed issue with imported active prop mutations Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
22 lines
712 B
JavaScript
22 lines
712 B
JavaScript
export function hasPathParams(params) {
|
|
return params
|
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
|
.some(({ type }) => type === "path")
|
|
}
|
|
|
|
export function addPathParamsToVariables(params, variables) {
|
|
params
|
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
|
.filter(({ key }) => !!key)
|
|
.filter(({ type }) => type === "path")
|
|
.forEach(({ key, value }) => (variables[key] = value))
|
|
return variables
|
|
}
|
|
|
|
export function getQueryParams(params) {
|
|
return params
|
|
.filter((item) => (item.hasOwnProperty("active") ? item.active == true : true))
|
|
.filter(({ key }) => !!key)
|
|
.filter(({ type }) => type != "path")
|
|
}
|