Skip to content

Commit

Permalink
Fix enabled feature flags object composition (#2899)
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
vinistock authored Nov 21, 2024
1 parent 3d95b97 commit d719b86
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions vscode/src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ interface ServerErrorTelemetryEvent {

type ServerTelemetryEvent = ServerErrorTelemetryEvent;

function enabledFeatureFlags() {
function enabledFeatureFlags(): Record<string, boolean> {
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
Expand Down

0 comments on commit d719b86

Please sign in to comment.