Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

chore: formatting updates

James George9f530fa47ec1
diff --git a/packages/hoppscotch-common/src/lib/sync/collections/index.ts b/packages/hoppscotch-common/src/lib/sync/collections/index.ts
index 9f2a6f32c..f719a4130 100644
--- a/packages/hoppscotch-common/src/lib/sync/collections/index.ts
+++ b/packages/hoppscotch-common/src/lib/sync/collections/index.ts
@@ -1017,11 +1017,7 @@ function setupUserRequestMovedSubscription() {
: undefined
// there is no nextRequest, so request is moved
- if (
- destinationCollectionPath &&
- sourceRequestPath &&
- !nextRequest
- ) {
+ if (destinationCollectionPath && sourceRequestPath && !nextRequest) {
runDispatchWithOutSyncing(() => {
requestType == "REST"
? moveRESTRequest(
diff --git a/packages/hoppscotch-common/src/lib/sync/mapper.ts b/packages/hoppscotch-common/src/lib/sync/mapper.ts
index d3e164bb8..5a9d6bad3 100644
--- a/packages/hoppscotch-common/src/lib/sync/mapper.ts
+++ b/packages/hoppscotch-common/src/lib/sync/mapper.ts
@@ -35,7 +35,8 @@ export const createMapper = <
const backendIdForLocal = backendIDByLocalIDMap.get(index)
backendIDByLocalIDMap.delete(index)
- backendIdForLocal != null && localIDByBackendIDMap.delete(backendIdForLocal)
+ backendIdForLocal != null &&
+ localIDByBackendIDMap.delete(backendIdForLocal)
}
},
}
diff --git a/packages/hoppscotch-common/src/newstore/collections.ts b/packages/hoppscotch-common/src/newstore/collections.ts
index 03b121af9..a6c2bec3b 100644
--- a/packages/hoppscotch-common/src/newstore/collections.ts
+++ b/packages/hoppscotch-common/src/newstore/collections.ts
@@ -509,7 +509,9 @@ const restCollectionDispatchers = defineDispatchers({
}
if (folderIndex < 0 || folderIndex >= containingFolder.folders.length) {
- console.error(`Folder index ${folderIndex} out of bounds. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds. Skipping request.`
+ )
return {}
}
const theFolder = containingFolder.folders.splice(folderIndex, 1)
@@ -567,7 +569,9 @@ const restCollectionDispatchers = defineDispatchers({
// We are moving a folder from the root
if (containingFolder === null) {
if (folderIndex < 0 || folderIndex >= newState.length) {
- console.error(`Folder index ${folderIndex} out of bounds in root. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds in root. Skipping request.`
+ )
return {}
}
const theFolder = newState.splice(folderIndex, 1)
@@ -575,7 +579,9 @@ const restCollectionDispatchers = defineDispatchers({
target.folders.push(theFolder[0])
} else {
if (folderIndex < 0 || folderIndex >= containingFolder.folders.length) {
- console.error(`Folder index ${folderIndex} out of bounds. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds. Skipping request.`
+ )
return {}
}
const theFolder = containingFolder.folders.splice(folderIndex, 1)
@@ -1194,7 +1200,9 @@ const gqlCollectionDispatchers = defineDispatchers({
}
if (folderIndex < 0 || folderIndex >= containingFolder.folders.length) {
- console.error(`Folder index ${folderIndex} out of bounds. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds. Skipping request.`
+ )
return {}
}
const theFolder = containingFolder.folders.splice(folderIndex, 1)
@@ -1252,7 +1260,9 @@ const gqlCollectionDispatchers = defineDispatchers({
// We are moving a folder from the root
if (containingFolder === null) {
if (folderIndex < 0 || folderIndex >= newState.length) {
- console.error(`Folder index ${folderIndex} out of bounds in root. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds in root. Skipping request.`
+ )
return {}
}
const theFolder = newState.splice(folderIndex, 1)
@@ -1260,7 +1270,9 @@ const gqlCollectionDispatchers = defineDispatchers({
target.folders.push(theFolder[0])
} else {
if (folderIndex < 0 || folderIndex >= containingFolder.folders.length) {
- console.error(`Folder index ${folderIndex} out of bounds. Skipping request.`)
+ console.error(
+ `Folder index ${folderIndex} out of bounds. Skipping request.`
+ )
return {}
}
const theFolder = containingFolder.folders.splice(folderIndex, 1)
@@ -2053,8 +2065,7 @@ export function removeGraphqlCollection(
collectionID?: string
) {
if (!collectionID) {
- collectionID =
- graphqlCollectionStore.value.state[collectionIndex]?.id
+ collectionID = graphqlCollectionStore.value.state[collectionIndex]?.id
}
graphqlCollectionStore.dispatch({
dispatcher: "removeCollection",
diff --git a/packages/hoppscotch-common/src/services/__tests__/cookie-jar.service.spec.ts b/packages/hoppscotch-common/src/services/__tests__/cookie-jar.service.spec.ts
index da50eb59c..02294964a 100644
--- a/packages/hoppscotch-common/src/services/__tests__/cookie-jar.service.spec.ts
+++ b/packages/hoppscotch-common/src/services/__tests__/cookie-jar.service.spec.ts
@@ -39,7 +39,9 @@ describe("CookieJarService", () => {
describe("toMap migration on hydrate", () => {
it("canonicalizes a leading-dot domain key from on-disk payload", () => {
const map = (service as any).toMap({
- ".Example.COM": [cookie({ name: "a", value: "1", domain: ".Example.COM" })],
+ ".Example.COM": [
+ cookie({ name: "a", value: "1", domain: ".Example.COM" }),
+ ],
})
expect(map.has("example.com")).toBe(true)
expect(map.get("example.com")?.[0].domain).toBe("example.com")
@@ -47,8 +49,12 @@ describe("CookieJarService", () => {
it("merges two non-canonical keys that collapse to the same canon", () => {
const map = (service as any).toMap({
- ".Example.COM": [cookie({ name: "a", value: "1", domain: ".Example.COM" })],
- "EXAMPLE.com": [cookie({ name: "b", value: "2", domain: "EXAMPLE.com" })],
+ ".Example.COM": [
+ cookie({ name: "a", value: "1", domain: ".Example.COM" }),
+ ],
+ "EXAMPLE.com": [
+ cookie({ name: "b", value: "2", domain: "EXAMPLE.com" }),
+ ],
})
expect(map.get("example.com")).toHaveLength(2)
})
@@ -198,7 +204,11 @@ describe("CookieJarService", () => {
it("skips a script-set cookie whose name is not a string", async () => {
await service.upsertCookies([
- { name: 42 as unknown as string, value: "1", domain: "example.com" } as Cookie,
+ {
+ name: 42 as unknown as string,
+ value: "1",
+ domain: "example.com",
+ } as Cookie,
])
expect(service.cookieJar.value.size).toBe(0)
})
@@ -315,7 +325,13 @@ describe("CookieJarService", () => {
(service as any).parseStored({
domains: {
"example.com": [
- { name: "a", value: "1", domain: "example.com", path: 1, secure: false },
+ {
+ name: "a",
+ value: "1",
+ domain: "example.com",
+ path: 1,
+ secure: false,
+ },
],
},
})
@@ -327,7 +343,13 @@ describe("CookieJarService", () => {
(service as any).parseStored({
domains: {
"example.com": [
- { name: "a", value: "1", domain: "example.com", path: "/", secure: "false" },
+ {
+ name: "a",
+ value: "1",
+ domain: "example.com",
+ path: "/",
+ secure: "false",
+ },
],
},
})