fix: strip exported TypeScript function overloads (#14458)

fixes #14455
pull/14451/head
Simon H 9 months ago committed by GitHub
parent 41e47a4c00
commit d6fc176fcb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: strip exported TypeScript function overloads

@ -36,7 +36,11 @@ const visitors = {
if (node.exportKind === 'type') return b.empty;
if (node.declaration) {
return context.next();
const result = context.next();
if (result?.declaration?.type === 'EmptyStatement') {
return b.empty;
}
return result;
}
if (node.specifiers) {

@ -27,6 +27,10 @@
export type Foo = true
}
export function overload(a: boolean): boolean;
export function overload(b: string): number;
export function overload(c: any): any {}
export type { Hello };
</script>

Loading…
Cancel
Save