diff --git a/packages/conform-dom/submission.ts b/packages/conform-dom/submission.ts index c1e2b594..eef241a3 100644 --- a/packages/conform-dom/submission.ts +++ b/packages/conform-dom/submission.ts @@ -524,14 +524,11 @@ export function setListState( }); } -export function serialize( - defaultValue: DefaultValue, -): FormValue { +export function serialize(defaultValue: Schema): FormValue { if (isPlainObject(defaultValue)) { // @ts-expect-error FIXME return Object.entries(defaultValue).reduce>( (result, [key, value]) => { - // @ts-ignore-error FIXME result[key] = serialize(value); return result; }, @@ -540,16 +537,16 @@ export function serialize( } else if (Array.isArray(defaultValue)) { // @ts-expect-error FIXME return defaultValue.map(serialize); - } else if ( - // @ts-ignore-error FIXME - defaultValue instanceof Date - ) { + } else if (defaultValue instanceof Date) { // @ts-expect-error FIXME return defaultValue.toISOString(); } else if (typeof defaultValue === 'boolean') { // @ts-expect-error FIXME return defaultValue ? 'on' : undefined; - } else if (typeof defaultValue === 'number') { + } else if ( + typeof defaultValue === 'number' || + typeof defaultValue === 'bigint' + ) { // @ts-expect-error FIXME return defaultValue.toString(); } else {