From 15a8becfe411240bb6e09aaf1cbed445e3a3f2b1 Mon Sep 17 00:00:00 2001 From: ayoayco Date: Mon, 7 Apr 2025 23:52:24 +0100 Subject: [PATCH] feat: initial undefined options handling --- package/src/index.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package/src/index.ts b/package/src/index.ts index e0bbf24..36d765f 100644 --- a/package/src/index.ts +++ b/package/src/index.ts @@ -13,10 +13,12 @@ import type { AstroIntegration } from 'astro' const ASTROSW = '@ayco/astro-sw' /** + * TODO: update JSDoc * Accepts configuration options with service worker path * and injects needed variables such as `__assets` generated by Astro */ export default function serviceWorker( + // TODO handle options undefined options?: AstroServiceWorkerConfig ): AstroIntegration { const { @@ -29,7 +31,7 @@ export default function serviceWorker( logAssets = false, esbuild = {}, registrationHooks = {}, - } = options || {} + } = options ?? {} const { installing: installingFn = () => {},