UNPKG

seitu

Version:
10 lines (9 loc) • 397 B
//#region src/utils/validation/index.ts function repairValueObjectWithDefault(props) { return { ...props.defaultValue, ...typeof props.value === "object" && props.value !== null ? Object.fromEntries(Object.entries(props.value).filter(([key, val]) => key in props.defaultValue && typeof val === typeof props.defaultValue[key])) : {} }; } //#endregion export { repairValueObjectWithDefault };