Use `Object.hasOwn()`
authorCyperghost <olaf_schmitz_1@t-online.de>
Tue, 24 Sep 2024 09:16:30 +0000 (11:16 +0200)
committerCyperghost <olaf_schmitz_1@t-online.de>
Mon, 14 Oct 2024 07:20:04 +0000 (09:20 +0200)
ts/WoltLabSuite/Core/Component/EmojiPicker/Setup.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/EmojiPicker/Setup.js

index a5ea7c3dc3bcda8808fb9e1e290a613d462a9898..2d62ac3f4f39cae6def2a6dfe1f3d17285ade738 100644 (file)
@@ -5,7 +5,7 @@ wheneverFirstSeen("emoji-picker", (emojiPicker: Picker) => {
   emojiPicker.locale = window.LANGUAGE_CODE;
   emojiPicker.dataSource = `${window.WSC_API_URL}emoji/index.php?l=${window.LANGUAGE_CODE}`;
 
-  if (window.EmojiPickerLocales[window.LANGUAGE_CODE] !== undefined) {
+  if (Object.hasOwn(window.EmojiPickerLocales, window.LANGUAGE_CODE)) {
     emojiPicker.i18n = window.EmojiPickerLocales[window.LANGUAGE_CODE];
   }
 });
index b03bb0c92ee620dafa44e7db79834c99ee357173..176a5485f63727e1b83e7045407982a8f9e04196 100644 (file)
@@ -4,7 +4,7 @@ define(["require", "exports", "WoltLabSuite/Core/Helper/Selector"], function (re
     (0, Selector_1.wheneverFirstSeen)("emoji-picker", (emojiPicker) => {
         emojiPicker.locale = window.LANGUAGE_CODE;
         emojiPicker.dataSource = `${window.WSC_API_URL}emoji/index.php?l=${window.LANGUAGE_CODE}`;
-        if (window.EmojiPickerLocales[window.LANGUAGE_CODE] !== undefined) {
+        if (Object.hasOwn(window.EmojiPickerLocales, window.LANGUAGE_CODE)) {
             emojiPicker.i18n = window.EmojiPickerLocales[window.LANGUAGE_CODE];
         }
     });