chore: format code

This commit is contained in:
Ayo Ayco 2024-08-25 13:45:38 +02:00
parent 536372d895
commit e5d0a5e65c

View file

@ -57,12 +57,12 @@ export default function serviceWorker(options) {
} = options || {};
const {
installing: installingFn = () => {},
waiting: waitingFn = () => {},
active: activeFn = () => {},
error: errorFn = () => {},
unsupported: unsupportedFn = () => {},
afterRegistration: afterRegistrationFn = () => {},
installing: installingFn = () => { },
waiting: waitingFn = () => { },
active: activeFn = () => { },
error: errorFn = () => { },
unsupported: unsupportedFn = () => { },
afterRegistration: afterRegistrationFn = () => { },
} = registrationHooks;
/**
@ -114,15 +114,14 @@ export default function serviceWorker(options) {
injectScript('page', registrationScript);
}
},
'astro:config:done': async ({injectTypes, logger}) => {
'astro:config:done': async ({ injectTypes, logger }) => {
let injectedTypes = `
declare const __assets: string[];
declare const __version: string;
declare const __prefix: string;`
injectTypes({filename: 'caching.d.ts', content: injectedTypes})
injectTypes({ filename: 'caching.d.ts', content: injectedTypes })
},
'astro:build:ssr': ({ manifest }) => {
if (output !== 'static') {
assets = manifest.assets
}
@ -206,10 +205,6 @@ declare const __prefix: string;`
const versionDeclaration = `const __version = ${JSON.stringify(assetCacheVersionID)};\n`;
const prefixDeclaration = `const __prefix = ${JSON.stringify(assetCachePrefix)};\n`;
/**
* TODO: allow importing in dev's sw.js by resolving imports
*/
const tempFile = `${swPath}.tmp.ts`;
try {