Skip to content

Commit ebbe2a7

Browse files
committed
reformat with fmt
1 parent ecb0fe4 commit ebbe2a7

2 files changed

Lines changed: 18 additions & 36 deletions

File tree

lib/input-handler.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ function createKeyEvent(
5252
shiftKey: modifiers.shift ?? false,
5353
metaKey: modifiers.meta ?? false,
5454
repeat: false,
55-
preventDefault: mock(() => { }),
56-
stopPropagation: mock(() => { }),
55+
preventDefault: mock(() => {}),
56+
stopPropagation: mock(() => {}),
5757
};
5858
}
5959

@@ -69,14 +69,14 @@ function createClipboardEvent(text: string | null): MockClipboardEvent {
6969
clipboardData:
7070
text !== null
7171
? {
72-
getData: (format: string) => data.get(format) || '',
73-
setData: (format: string, value: string) => {
74-
data.set(format, value);
75-
},
76-
}
72+
getData: (format: string) => data.get(format) || '',
73+
setData: (format: string, value: string) => {
74+
data.set(format, value);
75+
},
76+
}
7777
: null,
78-
preventDefault: mock(() => { }),
79-
stopPropagation: mock(() => { }),
78+
preventDefault: mock(() => {}),
79+
stopPropagation: mock(() => {}),
8080
};
8181
}
8282
interface MockCompositionEvent {
@@ -94,8 +94,8 @@ function createCompositionEvent(
9494
return {
9595
type,
9696
data,
97-
preventDefault: mock(() => { }),
98-
stopPropagation: mock(() => { }),
97+
preventDefault: mock(() => {}),
98+
stopPropagation: mock(() => {}),
9999
};
100100
}
101101
// Helper to create mock container
@@ -140,7 +140,7 @@ function createMockContainer(): MockHTMLElement & {
140140
appendChild(node: Node) {
141141
this.childNodes.push(node);
142142
return node;
143-
}
143+
},
144144
};
145145
}
146146

lib/input-handler.ts

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -239,22 +239,13 @@ export class InputHandler {
239239
this.container.addEventListener('paste', this.pasteListener);
240240

241241
this.compositionStartListener = this.handleCompositionStart.bind(this);
242-
this.container.addEventListener(
243-
'compositionstart',
244-
this.compositionStartListener
245-
);
242+
this.container.addEventListener('compositionstart', this.compositionStartListener);
246243

247244
this.compositionUpdateListener = this.handleCompositionUpdate.bind(this);
248-
this.container.addEventListener(
249-
'compositionupdate',
250-
this.compositionUpdateListener
251-
);
245+
this.container.addEventListener('compositionupdate', this.compositionUpdateListener);
252246

253247
this.compositionEndListener = this.handleCompositionEnd.bind(this);
254-
this.container.addEventListener(
255-
'compositionend',
256-
this.compositionEndListener
257-
);
248+
this.container.addEventListener('compositionend', this.compositionEndListener);
258249
}
259250

260251
/**
@@ -587,26 +578,17 @@ export class InputHandler {
587578
}
588579

589580
if (this.compositionStartListener) {
590-
this.container.removeEventListener(
591-
'compositionstart',
592-
this.compositionStartListener
593-
);
581+
this.container.removeEventListener('compositionstart', this.compositionStartListener);
594582
this.compositionStartListener = null;
595583
}
596584

597585
if (this.compositionUpdateListener) {
598-
this.container.removeEventListener(
599-
'compositionupdate',
600-
this.compositionUpdateListener
601-
);
586+
this.container.removeEventListener('compositionupdate', this.compositionUpdateListener);
602587
this.compositionUpdateListener = null;
603588
}
604589

605590
if (this.compositionEndListener) {
606-
this.container.removeEventListener(
607-
'compositionend',
608-
this.compositionEndListener
609-
);
591+
this.container.removeEventListener('compositionend', this.compositionEndListener);
610592
this.compositionEndListener = null;
611593
}
612594

0 commit comments

Comments
 (0)