chore: merge hoppscotch/patch into hoppscotch/next

This commit is contained in:
Andrew Bastin
2024-06-24 16:09:12 +05:30
6 changed files with 18 additions and 8 deletions

View File

@@ -59,6 +59,7 @@ export const baseTheme = EditorView.theme({
backgroundColor: "var(--accent-dark-color)",
color: "var(--accent-contrast-color)",
borderRadius: "2px",
opacity: "0.4",
},
".cm-panels": {
backgroundColor: "var(--primary-light-color)",

View File

@@ -48,8 +48,13 @@ const parseInsomniaDoc = (content: string) =>
const replacePathVarTemplating = (expression: string) =>
expression.replaceAll(/:([^/]+)/g, "<<$1>>")
const replaceVarTemplating = (expression: string) =>
pipe(expression, replacePathVarTemplating, replaceInsomniaTemplating)
const replaceVarTemplating = (expression: string, pathVar = false) => {
return pipe(
expression,
pathVar ? replacePathVarTemplating : (x) => x,
replaceInsomniaTemplating
)
}
const getFoldersIn = (
folder: InsomniaFolderResource | null,
@@ -208,7 +213,7 @@ const getHoppRequest = (req: InsomniaRequestResource): HoppRESTRequest =>
makeRESTRequest({
name: req.name ?? "Untitled Request",
method: req.method?.toUpperCase() ?? "GET",
endpoint: replaceVarTemplating(req.url ?? ""),
endpoint: replaceVarTemplating(req.url ?? "", true),
auth: getHoppReqAuth(req),
body: getHoppReqBody(req),
headers: getHoppReqHeaders(req),