perf: Variety of small type and performance fixes (#2367)

This commit is contained in:
Dermot Duffy
2026-02-22 15:02:14 -08:00
committed by GitHub
parent 0f8c758d38
commit 497e6e88a0
10 changed files with 82 additions and 53 deletions
+8 -12
View File
@@ -73,18 +73,14 @@ export class ConfigManager {
(hint ?? localize('error.invalid_configuration_no_hint')),
);
}
const config = advancedCameraCardConfigSchema.parse(
setProfiles(
inputConfig,
// The config is cloned here because Zod 4 returns shared constant
// defaults by reference. Since setProfiles() mutates the configuration
// in-place, those mutations would "pollute" the global defaults and break
// test isolation if we didn't use a fresh clone here.
copyConfig(parseResult.data),
parseResult.data.profiles,
),
// The config is cloned here because Zod 4 returns shared constant
// defaults by reference. Since setProfiles() mutates the configuration
// in-place, those mutations would "pollute" the global defaults and break
// test isolation if we didn't use a fresh clone here.
const config = setProfiles(
inputConfig,
copyConfig(parseResult.data),
parseResult.data.profiles,
);
this._rawConfig = inputConfig;