From a97c3aacc2765f6e16f6727739e680f22fa98e7d Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 06:01:36 +0000 Subject: [PATCH 1/5] Restyled by clang-format --- sw.js | 77 ++++++++++++++++++++++++++++------------------------------- 1 file changed, 37 insertions(+), 40 deletions(-) diff --git a/sw.js b/sw.js index cf7fd91..5cfe94a 100644 --- a/sw.js +++ b/sw.js @@ -1,50 +1,47 @@ -import { registerRoute } from 'workbox-routing'; +// Used for filtering matches based on status code, header, or both +import {CacheableResponsePlugin} from 'workbox-cacheable-response'; +// Used to limit entries in cache, remove entries after a certain period of time +import {ExpirationPlugin} from 'workbox-expiration'; +import {registerRoute} from 'workbox-routing'; import { + CacheFirst, NetworkFirst, StaleWhileRevalidate, - CacheFirst, } from 'workbox-strategies'; -// Used for filtering matches based on status code, header, or both -import { CacheableResponsePlugin } from 'workbox-cacheable-response'; -// Used to limit entries in cache, remove entries after a certain period of time -import { ExpirationPlugin } from 'workbox-expiration'; - // Cache page navigations (html) with a Network First strategy registerRoute( - // Check to see if the request is a navigation to a new page - ({ request }) => request.mode === 'navigate', - // Use a Network First caching strategy - new NetworkFirst({ - // Put all cached files in a cache named 'pages' - cacheName: 'pages', - plugins: [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses: [200], - }), - ], - }) -); + // Check to see if the request is a navigation to a new page + ({request}) => request.mode === 'navigate', + // Use a Network First caching strategy + new NetworkFirst({ + // Put all cached files in a cache named 'pages' + cacheName : 'pages', + plugins : [ + // Ensure that only requests that result in a 200 status are cached + new CacheableResponsePlugin({ + statuses : [ 200 ], + }), + ], + })); // Cache images with a Cache First strategy registerRoute( - // Check to see if the request's destination is style for an image - ({ request }) => request.destination === 'image', - // Use a Cache First caching strategy - new CacheFirst({ - // Put all cached files in a cache named 'images' - cacheName: 'images', - plugins: [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses: [200], - }), - // Don't cache more than 50 items, and expire them after 30 days - new ExpirationPlugin({ - maxEntries: 50, - maxAgeSeconds: 60 * 60 * 24 * 30, // 30 Days - }), - ], - }) -); + // Check to see if the request's destination is style for an image + ({request}) => request.destination === 'image', + // Use a Cache First caching strategy + new CacheFirst({ + // Put all cached files in a cache named 'images' + cacheName : 'images', + plugins : [ + // Ensure that only requests that result in a 200 status are cached + new CacheableResponsePlugin({ + statuses : [ 200 ], + }), + // Don't cache more than 50 items, and expire them after 30 days + new ExpirationPlugin({ + maxEntries : 50, + maxAgeSeconds : 60 * 60 * 24 * 30, // 30 Days + }), + ], + })); From 1135aad5a898082d2e994c4ea97e951a57b7c6c5 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 06:01:38 +0000 Subject: [PATCH 2/5] Restyled by jq --- tsconfig.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 8928264..fddfc63 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,8 @@ { - "exclude": ["dist/*.*", "*.js"], + "exclude": [ + "dist/*.*", + "*.js" + ], "compilerOptions": { "strict": true, "module": "commonjs", @@ -8,7 +11,10 @@ "esModuleInterop": true, "sourceMap": true, "allowJs": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "rootDir": "src", "moduleResolution": "node" } From 27c53e03d5bc5a05525c771f3c1ec6df63ecb449 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 06:01:40 +0000 Subject: [PATCH 3/5] Restyled by prettier-json --- tsconfig.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index fddfc63..8928264 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,5 @@ { - "exclude": [ - "dist/*.*", - "*.js" - ], + "exclude": ["dist/*.*", "*.js"], "compilerOptions": { "strict": true, "module": "commonjs", @@ -11,10 +8,7 @@ "esModuleInterop": true, "sourceMap": true, "allowJs": true, - "lib": [ - "es6", - "dom" - ], + "lib": ["es6", "dom"], "rootDir": "src", "moduleResolution": "node" } From 5b97971642140a215c39e5db36f2a9d81717e663 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 06:01:41 +0000 Subject: [PATCH 4/5] Restyled by prettier-markdown --- readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index ef470e1..c6dfadf 100644 --- a/readme.md +++ b/readme.md @@ -1,6 +1,7 @@ # What Pokemon Are You Today ! -This little project have just a single utility: telling you what Pokemon you are today ! +This little project have just a single utility: telling you what Pokemon you are +today ! GitHub forks GitHub stars From c56d4440cbf1b86924674fb61aa9ad43830f2462 Mon Sep 17 00:00:00 2001 From: "Restyled.io" Date: Fri, 25 Jun 2021 06:01:41 +0000 Subject: [PATCH 5/5] Restyled by prettier --- sw.js | 72 ++++++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/sw.js b/sw.js index 5cfe94a..e911ec5 100644 --- a/sw.js +++ b/sw.js @@ -1,47 +1,49 @@ // Used for filtering matches based on status code, header, or both -import {CacheableResponsePlugin} from 'workbox-cacheable-response'; +import { CacheableResponsePlugin } from "workbox-cacheable-response"; // Used to limit entries in cache, remove entries after a certain period of time -import {ExpirationPlugin} from 'workbox-expiration'; -import {registerRoute} from 'workbox-routing'; +import { ExpirationPlugin } from "workbox-expiration"; +import { registerRoute } from "workbox-routing"; import { CacheFirst, NetworkFirst, StaleWhileRevalidate, -} from 'workbox-strategies'; +} from "workbox-strategies"; // Cache page navigations (html) with a Network First strategy registerRoute( - // Check to see if the request is a navigation to a new page - ({request}) => request.mode === 'navigate', - // Use a Network First caching strategy - new NetworkFirst({ - // Put all cached files in a cache named 'pages' - cacheName : 'pages', - plugins : [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses : [ 200 ], - }), - ], - })); + // Check to see if the request is a navigation to a new page + ({ request }) => request.mode === "navigate", + // Use a Network First caching strategy + new NetworkFirst({ + // Put all cached files in a cache named 'pages' + cacheName: "pages", + plugins: [ + // Ensure that only requests that result in a 200 status are cached + new CacheableResponsePlugin({ + statuses: [200], + }), + ], + }) +); // Cache images with a Cache First strategy registerRoute( - // Check to see if the request's destination is style for an image - ({request}) => request.destination === 'image', - // Use a Cache First caching strategy - new CacheFirst({ - // Put all cached files in a cache named 'images' - cacheName : 'images', - plugins : [ - // Ensure that only requests that result in a 200 status are cached - new CacheableResponsePlugin({ - statuses : [ 200 ], - }), - // Don't cache more than 50 items, and expire them after 30 days - new ExpirationPlugin({ - maxEntries : 50, - maxAgeSeconds : 60 * 60 * 24 * 30, // 30 Days - }), - ], - })); + // Check to see if the request's destination is style for an image + ({ request }) => request.destination === "image", + // Use a Cache First caching strategy + new CacheFirst({ + // Put all cached files in a cache named 'images' + cacheName: "images", + plugins: [ + // Ensure that only requests that result in a 200 status are cached + new CacheableResponsePlugin({ + statuses: [200], + }), + // Don't cache more than 50 items, and expire them after 30 days + new ExpirationPlugin({ + maxEntries: 50, + maxAgeSeconds: 60 * 60 * 24 * 30, // 30 Days + }), + ], + }) +);