feat: initial undefined options handling
This commit is contained in:
parent
6e64d75b1c
commit
15a8becfe4
1 changed files with 3 additions and 1 deletions
|
@ -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 = () => {},
|
||||
|
|
Loading…
Reference in a new issue