anderx пре 9 месеци
родитељ
комит
fd8fdc1378
1 измењених фајлова са 29 додато и 29 уклоњено
  1. 29 29
      public/mockServiceWorker.js

+ 29 - 29
public/mockServiceWorker.js

@@ -2,7 +2,7 @@
 /* tslint:disable */
 
 /**
- * Mock Service Worker (0.48.1).
+ * Mock Service Worker (0.48.3).
  * @see https://github.com/mswjs/msw
  * - Please do NOT modify this file.
  * - Please do NOT serve this file on production.
@@ -115,25 +115,25 @@ self.addEventListener('fetch', function (event) {
   const requestId = Math.random().toString(16).slice(2)
 
   event.respondWith(
-    handleRequest(event, requestId).catch((error) => {
-      if (error.name === 'NetworkError') {
-        console.warn(
-          '[MSW] Successfully emulated a network error for the "%s %s" request.',
-          request.method,
-          request.url,
-        )
-        return
-      }
-
-      // At this point, any exception indicates an issue with the original request/response.
-      console.error(
-        `\
+      handleRequest(event, requestId).catch((error) => {
+        if (error.name === 'NetworkError') {
+          console.warn(
+              '[MSW] Successfully emulated a network error for the "%s %s" request.',
+              request.method,
+              request.url,
+          )
+          return
+        }
+
+        // At this point, any exception indicates an issue with the original request/response.
+        console.error(
+            `\
 [MSW] Caught an exception from the "%s %s" request (%s). This is probably not a problem with Mock Service Worker. There is likely an additional logging output above.`,
-        request.method,
-        request.url,
-        `${error.name}: ${error.message}`,
-      )
-    }),
+            request.method,
+            request.url,
+            `${error.name}: ${error.message}`,
+        )
+      }),
   )
 })
 
@@ -156,7 +156,7 @@ async function handleRequest(event, requestId) {
           status: clonedResponse.status,
           statusText: clonedResponse.statusText,
           body:
-            clonedResponse.body === null ? null : await clonedResponse.text(),
+              clonedResponse.body === null ? null : await clonedResponse.text(),
           headers: Object.fromEntries(clonedResponse.headers.entries()),
           redirected: clonedResponse.redirected,
         },
@@ -183,15 +183,15 @@ async function resolveMainClient(event) {
   })
 
   return allClients
-    .filter((client) => {
-      // Get only those clients that are currently visible.
-      return client.visibilityState === 'visible'
-    })
-    .find((client) => {
-      // Find the client ID that's recorded in the
-      // set of clients that have registered the worker.
-      return activeClientIds.has(client.id)
-    })
+      .filter((client) => {
+        // Get only those clients that are currently visible.
+        return client.visibilityState === 'visible'
+      })
+      .find((client) => {
+        // Find the client ID that's recorded in the
+        // set of clients that have registered the worker.
+        return activeClientIds.has(client.id)
+      })
 }
 
 async function getResponse(event, client, requestId) {