fix: repair stale custom widget options
This commit is contained in:
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>,
|
||||
|
||||
Reference in new issue
Block a user