fix: repair stale custom widget options

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-13 19:51:25 +02:00
1 parent 03ebb8c2db
commit c2cf25b4fb
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>,