Skip to content

Commit

Permalink
fix getPrebuildSettings
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Oct 2, 2023
1 parent 11b6d0c commit 53e5225
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/gitpod-protocol/src/teams-projects-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,15 @@ export namespace Project {
* contain default values for properties which are not set explicitly for this project.
*/
export function getPrebuildSettings(project: Project): PrebuildSettingsWithDefaults {
const effective = {
// ignoring persisted properties with `undefined` values to exclude them from the override.
const overrides = Object.fromEntries(
Object.entries(project.settings?.prebuilds ?? {}).filter(([_, value]) => value !== undefined),
);

return {
...PREBUILD_SETTINGS_DEFAULTS,
...project.settings?.prebuilds,
...overrides,
};
return effective;
}

export function hasPrebuildSettings(project: Project) {
Expand Down

0 comments on commit 53e5225

Please sign in to comment.