From 3906daad54089faaeb8d7e05551c39e334cb242f Mon Sep 17 00:00:00 2001 From: max-lovell Date: Mon, 5 Aug 2024 12:10:25 +0100 Subject: [PATCH] Replace Array.from() with spread operator --- packages/jspsych/src/modules/plugin-api/KeyboardListenerAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/jspsych/src/modules/plugin-api/KeyboardListenerAPI.ts b/packages/jspsych/src/modules/plugin-api/KeyboardListenerAPI.ts index 82e1ed7f..6259d82c 100644 --- a/packages/jspsych/src/modules/plugin-api/KeyboardListenerAPI.ts +++ b/packages/jspsych/src/modules/plugin-api/KeyboardListenerAPI.ts @@ -48,7 +48,7 @@ export class KeyboardListenerAPI { private rootKeydownListener(e: KeyboardEvent) { // Iterate over a static copy of the listeners set because listeners might add other listeners // that we do not want to be included in the loop - for (const listener of Array.from(this.listeners)) { + for (const listener of [...this.listeners]) { listener(e); } this.heldKeys.add(this.toLowerCaseIfInsensitive(e.key));