fix: repair stale custom widget options

This commit is contained in:
Thomas Camlong committed 2026-08-09 09:17:32 +02:00
1 parent 8dad83f720
commit d513c7fe46
5 files changed
+81 -10

No files matched your search

@@ -12,6 +12,18 @@ export function getCustomWidgetDefaultOptions(
return Object.fromEntries(Object.entries(options).map(([name, option]) => [name, option.default]));
}
export function normalizeCustomWidgetOptions(
options: CustomWidgetOptions,
value: Record<string, unknown>,
): Record<string, unknown> {
return Object.fromEntries(
Object.entries(options).map(([name, option]) => [
name,
getCustomWidgetOptionValueIssue(option, value[name]) ? option.default : value[name],
]),
);
}
export function validateCustomWidgetOptions(
options: CustomWidgetOptions,
value: Record<string, unknown>,