Skip to content

Commit

Permalink
🐛 WebConfig fix underscore props in constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Sep 11, 2024
1 parent 03cdc1d commit 2397ed6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/script/webConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ export default class WebConfig extends Config {
// Apply the Config defaults
super(config);

// Overcome Object.assign not overwriting undefined values for underscore keys
const underscoreKeys = Object.keys(config).filter((key) => key[0] === '_');
for (const underscoreKey of underscoreKeys) {
if (config[underscoreKey]) this[underscoreKey] = config[underscoreKey];
}

// Apply class defaults
Object.assign(this, this.Class._webDefaults, config);
}
Expand Down

0 comments on commit 2397ed6

Please sign in to comment.