fix: 🩹 update partytown options ts type (#7175)

This commit is contained in:
Akash Rajpurohit 2023-05-25 13:54:59 +05:30 committed by GitHub
parent dc31b8a722
commit 59d8c50b84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 6 deletions

View file

@ -0,0 +1,5 @@
---
'@astrojs/partytown': patch
---
fix typescript type for partytown options

View file

@ -9,17 +9,15 @@ import { fileURLToPath } from 'url';
import sirv from './sirv.js';
const resolve = createRequire(import.meta.url).resolve;
type PartytownOptions =
| {
config?: PartytownConfig;
}
| undefined;
type PartytownOptions = {
config?: PartytownConfig;
};
function appendForwardSlash(str: string) {
return str.endsWith('/') ? str : str + '/';
}
export default function createPlugin(options: PartytownOptions): AstroIntegration {
export default function createPlugin(options?: PartytownOptions): AstroIntegration {
let config: AstroConfig;
let partytownSnippetHtml: string;
const partytownEntrypoint = resolve('@builder.io/partytown/package.json');