From cd8ad5618249edf5e7158969845eccb421e1f6f0 Mon Sep 17 00:00:00 2001 From: Michael Brandt Date: Fri, 28 Jun 2024 09:46:09 +0200 Subject: [PATCH] Make modifiedValues typesafe --- packages/simple-form/src/get-form-manager.ts | 2 +- packages/simple-form/src/utils.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/simple-form/src/get-form-manager.ts b/packages/simple-form/src/get-form-manager.ts index 9ed1063..6af126a 100644 --- a/packages/simple-form/src/get-form-manager.ts +++ b/packages/simple-form/src/get-form-manager.ts @@ -67,7 +67,7 @@ export const getFormManager = (formDefinition: ReturnType(formState: FormState, fieldName return values; }; -export const getModifiedFieldValues = >(initialFieldValues: T, fieldValues: T) => { +export const getModifiedFieldValues = >(initialFieldValues: T, fieldValues: T) => { const initialFieldValueEntries = new Map(Object.entries(initialFieldValues)); const fieldValueEntries = Object.entries(fieldValues); return Object.fromEntries( @@ -82,5 +82,5 @@ export const getModifiedFieldValues = >(initia const initialValue = initialFieldValueEntries.get(key); return !isEqual(value, initialValue); }) - ); + ) as Partial; };