Skip to content

Commit 9293274

Browse files
tenphiCopilot
andauthored
Update src/components/actions/use-action.ts
Co-authored-by: Copilot <[email protected]>
1 parent f5d7841 commit 9293274

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/components/actions/use-action.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,19 @@ export function parseTo(to: NavigateArg | undefined): {
140140
};
141141
}
142142

143-
function sanitizePressEvent(evt: PressEvent): PressEvent {
144-
const safeEvt: any = {
143+
interface SanitizedPressEvent {
144+
type?: string;
145+
pointerType?: string;
146+
shiftKey: boolean;
147+
metaKey: boolean;
148+
ctrlKey: boolean;
149+
altKey: boolean;
150+
// target is defined as a non-enumerable property below
151+
[key: string]: unknown; // allow non-enumerable 'target'
152+
}
153+
154+
function sanitizePressEvent(evt: PressEvent): SanitizedPressEvent {
155+
const safeEvt: SanitizedPressEvent = {
145156
type: (evt as any)?.type,
146157
pointerType: (evt as any)?.pointerType,
147158
shiftKey: !!(evt as any)?.shiftKey,

0 commit comments

Comments
 (0)