From d719b86e161e81e226d6c4235971291fccd7338a Mon Sep 17 00:00:00 2001 From: Vinicius Stock Date: Thu, 21 Nov 2024 16:37:07 -0500 Subject: [PATCH] Fix enabled feature flags object composition (#2899) ### Motivation I made a mistake when mapping the feature flags into an object. They are supposed to be a hash like object and not an array. ### Implementation Used `Object.fromEntries` to build the hash. --- vscode/src/client.ts | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/vscode/src/client.ts b/vscode/src/client.ts index 114b385f2..7e29c915f 100644 --- a/vscode/src/client.ts +++ b/vscode/src/client.ts @@ -52,12 +52,9 @@ interface ServerErrorTelemetryEvent { type ServerTelemetryEvent = ServerErrorTelemetryEvent; -function enabledFeatureFlags() { +function enabledFeatureFlags(): Record { const allKeys = Object.keys(FEATURE_FLAGS) as (keyof typeof FEATURE_FLAGS)[]; - - return allKeys.map((key) => { - return { [key]: featureEnabled(key) }; - }); + return Object.fromEntries(allKeys.map((key) => [key, featureEnabled(key)])); } // Get the executables to start the server based on the user's configuration