valoq-math-work 1.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "valoq-math-work",
3
+ "version": "1.0.11",
4
+ "description": "Math Hub",
5
+ "main": "index.html",
6
+ "files": [
7
+ "*"
8
+ ]
9
+ }
package/uv/sw.js ADDED
@@ -0,0 +1,35 @@
1
+ importScripts('uv.bundle.js');
2
+ importScripts('uv.config.js');
3
+ importScripts(__uv$config.sw || 'uv.sw.js');
4
+
5
+ const uv = new UVServiceWorker();
6
+ let config = {
7
+ blocklist: new Set(),
8
+ }
9
+
10
+ async function handleRequest(event) {
11
+ if (uv.route(event)) {
12
+ if (config.blocklist.size !== 0) {
13
+ let decodedUrl = new URL(__uv$config.decodeUrl(new URL(event.request.url).pathname.slice(__uv$config.prefix.length)));
14
+ if (config.blocklist.has(decodedUrl.hostname)) {
15
+ return new Response("", { status: 404 });
16
+ }
17
+ }
18
+ return await uv.fetch(event);
19
+ }
20
+
21
+ return await fetch(event.request);
22
+ }
23
+
24
+ self.addEventListener('fetch', (event) => {
25
+ event.respondWith(handleRequest(event));
26
+ });
27
+
28
+ self.addEventListener("message", (event) => {
29
+ config = event.data;
30
+ });
31
+
32
+ self.addEventListener("activate", () => {
33
+ const bc = new BroadcastChannel("UvServiceWorker");
34
+ bc.postMessage("Active");
35
+ });