Skip to content

Commit 163b178

Browse files
committed
Fix: cleanup composedpath return
Also added node modules to be excluded from tsconfig
1 parent c845c02 commit 163b178

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/forcedRetargeting.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ function dispatchEvent(
5151
}
5252
}
5353

54-
function composedPath(el: HTMLElement | null): any {
54+
function composedPath(
55+
el: HTMLElement | null,
56+
): (Node | (Window & typeof globalThis))[] {
5557
const path = [];
5658
while (el) {
5759
path.push(el);
@@ -62,7 +64,7 @@ function composedPath(el: HTMLElement | null): any {
6264
}
6365
el = el.parentElement;
6466
}
65-
return [el];
67+
return [];
6668
}
6769

6870
export default function retargetEvents(shadowRoot: Node): () => void {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@
1717
"target": "es5"
1818
},
1919
"include": ["src"],
20-
"exclude": ["src/__tests__"]
20+
"exclude": ["src/__tests__", "node_modules"]
2121
}

0 commit comments

Comments
 (0)