chore: split app to commons and web (squash commit)

This commit is contained in:
Andrew Bastin
2022-12-02 02:57:46 -05:00
parent fb827e3586
commit 3d004f2322
535 changed files with 1487 additions and 501 deletions

View File

@@ -0,0 +1,33 @@
export function hasPathParams(params) {
return params
.filter((item) =>
Object.prototype.hasOwnProperty.call(item, "active")
? item.active === true
: true
)
.some(({ type }) => type === "path")
}
export function addPathParamsToVariables(params, variables) {
params
.filter((item) =>
Object.prototype.hasOwnProperty.call(item, "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) =>
Object.prototype.hasOwnProperty.call(item, "active")
? item.active === true
: true
)
.filter(({ key }) => !!key)
.filter(({ type }) => type !== "path")
}