fix: use strict TS in Input.ts (#8392)

This commit is contained in:
Alex Rudenko 2022-05-24 16:28:36 +02:00 committed by GitHub
parent f657233ca4
commit af92a24ba9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,7 +209,7 @@ export class Keyboard {
} }
private charIsKey(char: string): char is KeyInput { private charIsKey(char: string): char is KeyInput {
return !!keyDefinitions[char]; return !!keyDefinitions[char as KeyInput];
} }
/** /**
@ -235,7 +235,7 @@ export class Keyboard {
* Defaults to 0. * Defaults to 0.
*/ */
async type(text: string, options: { delay?: number } = {}): Promise<void> { async type(text: string, options: { delay?: number } = {}): Promise<void> {
const delay = options.delay || null; const delay = options.delay || undefined;
for (const char of text) { for (const char of text) {
if (this.charIsKey(char)) { if (this.charIsKey(char)) {
await this.press(char, { delay }); await this.press(char, { delay });