From: Cyperghost Date: Tue, 24 Sep 2024 09:16:30 +0000 (+0200) Subject: Use `Object.hasOwn()` X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9acb5df12799c0d94c87f891289195890ea787e1;p=GitHub%2FWoltLab%2FWCF.git Use `Object.hasOwn()` --- diff --git a/ts/WoltLabSuite/Core/Component/EmojiPicker/Setup.ts b/ts/WoltLabSuite/Core/Component/EmojiPicker/Setup.ts index a5ea7c3dc3..2d62ac3f4f 100644 --- a/ts/WoltLabSuite/Core/Component/EmojiPicker/Setup.ts +++ b/ts/WoltLabSuite/Core/Component/EmojiPicker/Setup.ts @@ -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]; } }); diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/EmojiPicker/Setup.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/EmojiPicker/Setup.js index b03bb0c92e..176a5485f6 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Component/EmojiPicker/Setup.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Component/EmojiPicker/Setup.js @@ -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]; } });