From 37749d4b60891437dee3c66ab887b8c3f1b05473 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Fri, 5 Feb 2021 16:05:26 +0100 Subject: [PATCH] Use Object.entries() in Core/Language#addObject() --- ts/WoltLabSuite/Core/Language.ts | 4 ++-- wcfsetup/install/files/js/WoltLabSuite/Core/Language.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ts/WoltLabSuite/Core/Language.ts b/ts/WoltLabSuite/Core/Language.ts index 8287e8b41c..e61b0e62ee 100644 --- a/ts/WoltLabSuite/Core/Language.ts +++ b/ts/WoltLabSuite/Core/Language.ts @@ -18,8 +18,8 @@ export { get } from "./Language/Store"; * Adds all the language items in the given object to the store. */ export function addObject(object: LanguageItems): void { - Object.keys(object).forEach((key) => { - add(key, object[key]); + Object.entries(object).forEach(([key, value]) => { + add(key, value); }); } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Language.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Language.js index 559835e40a..ae76f0b437 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Language.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Language.js @@ -17,8 +17,8 @@ define(["require", "exports", "tslib", "./Template", "./Language/Store", "./Lang * Adds all the language items in the given object to the store. */ function addObject(object) { - Object.keys(object).forEach((key) => { - add(key, object[key]); + Object.entries(object).forEach(([key, value]) => { + add(key, value); }); } exports.addObject = addObject; -- 2.20.1