ソースを参照

refactor(js): avoid returning values from forEach callbacks to prevent ignored results

Frédéric Guillot 2 ヶ月 前
コミット
39840bb0d2
2 ファイル変更9 行追加5 行削除
  1. 3 3
      internal/ui/static/js/app.js
  2. 6 2
      internal/ui/static/js/webauthn_handler.js

+ 3 - 3
internal/ui/static/js/app.js

@@ -491,9 +491,9 @@ function toggleAriaAttributesOnMainMenu() {
         homePageLinkElement.tabIndex = -1;
     } else {
         // Remove mobile menu button attributes
-        ["role", "tabindex", "aria-expanded", "aria-label"].forEach(attr =>
-            logoElement.removeAttribute(attr)
-        );
+        ["role", "tabindex", "aria-expanded", "aria-label"].forEach(attr => {
+            logoElement.removeAttribute(attr);
+        });
         homePageLinkElement.removeAttribute("tabindex");
     }
 }

+ 6 - 2
internal/ui/static/js/webauthn_handler.js

@@ -93,7 +93,9 @@ class WebAuthnHandler {
         credentialCreationOptions.publicKey.challenge = this.decodeBuffer(credentialCreationOptions.publicKey.challenge);
         credentialCreationOptions.publicKey.user.id = this.decodeBuffer(credentialCreationOptions.publicKey.user.id);
         if (Object.hasOwn(credentialCreationOptions.publicKey, 'excludeCredentials')) {
-            credentialCreationOptions.publicKey.excludeCredentials.forEach((credential) => credential.id = this.decodeBuffer(credential.id));
+            credentialCreationOptions.publicKey.excludeCredentials.forEach((credential) => {
+                credential.id = this.decodeBuffer(credential.id);
+            });
         }
 
         let attestation;
@@ -148,7 +150,9 @@ class WebAuthnHandler {
         credentialRequestOptions.publicKey.challenge = this.decodeBuffer(credentialRequestOptions.publicKey.challenge);
 
         if (Object.hasOwn(credentialRequestOptions.publicKey, 'allowCredentials')) {
-            credentialRequestOptions.publicKey.allowCredentials.forEach((credential) => credential.id = this.decodeBuffer(credential.id));
+            credentialRequestOptions.publicKey.allowCredentials.forEach((credential) => {
+                credential.id = this.decodeBuffer(credential.id);
+            });
         }
 
         if (abortController) {