@@ -365,33 +365,6 @@ export function getPathValue(
365365 return pointer ;
366366}
367367
368- /**
369- * Check if a form value is considered empty and should be stripped from the submission.
370- * A value is empty if:
371- * - It's an empty string ""
372- * - It's an empty File (size 0 and name "")
373- * - It's an array where all items are empty
374- */
375- function isEmptyValue (
376- value : FormDataEntryValue | FormDataEntryValue [ ] | undefined ,
377- ) : boolean {
378- if ( value === '' || value === undefined ) {
379- return true ;
380- }
381-
382- if ( isGlobalInstance ( value , 'File' ) ) {
383- // Empty File has size 0 and empty name
384- return value . size === 0 && value . name === '' ;
385- }
386-
387- if ( Array . isArray ( value ) ) {
388- // If all items are empty, consider it empty
389- return value . every ( ( item ) => isEmptyValue ( item ) ) ;
390- }
391-
392- return false ;
393- }
394-
395368/**
396369 * Parse `FormData` or `URLSearchParams` into a submission object.
397370 * This function structures the form values based on the naming convention.
@@ -436,15 +409,6 @@ export function parseSubmission(
436409 * Return `true` to skip the entry.
437410 */
438411 skipEntry ?: ( ( name : string ) => boolean ) | undefined ;
439- /**
440- * Whether to strip empty values (empty strings, empty files, arrays with all empty values)
441- * from the submission payload. Defaults to `false`.
442- *
443- * @deprecated This option will be removed in a future minor release.
444- * If you are using a schema library like Zod or Valibot, our integration
445- * already strips empty values for you. There is no need to use this option.
446- */
447- stripEmptyValues ?: boolean | undefined ;
448412 } ,
449413) : Submission {
450414 const intentName = options ?. intentName ?? DEFAULT_INTENT_NAME ;
@@ -455,7 +419,6 @@ export function parseSubmission(
455419 } ;
456420
457421 const segmentsByName = new Map < string , Array < string | number > | null > ( ) ;
458- const stripEmptyValues = options ?. stripEmptyValues ?? false ;
459422 let intentValue : string | null | undefined = undefined ;
460423
461424 for ( const [ name , entryValue ] of formData ) {
@@ -499,10 +462,6 @@ export function parseSubmission(
499462 submission . payload ,
500463 segments ,
501464 ( current : unknown ) => {
502- if ( stripEmptyValues && isEmptyValue ( entryValue ) ) {
503- return current ;
504- }
505-
506465 if ( Array . isArray ( current ) ) {
507466 current . push ( entryValue ) ;
508467 return current ;
@@ -566,8 +525,6 @@ export function report(
566525 keepFiles ?: false ;
567526 error ?: null ;
568527 targetValue ?: Record < string , FormValue > | null ;
569- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
570- value ?: Record < string , FormValue > | null ;
571528 hideFields ?: string [ ] ;
572529 reset ?: boolean ;
573530 } ,
@@ -578,8 +535,6 @@ export function report(
578535 keepFiles : true ;
579536 error ?: null ;
580537 targetValue ?: Record < string , FormValue > | null ;
581- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
582- value ?: Record < string , FormValue > | null ;
583538 hideFields ?: string [ ] ;
584539 reset ?: boolean ;
585540 } ,
@@ -590,8 +545,6 @@ export function report<ErrorShape>(
590545 keepFiles ?: false ;
591546 error : CustomError < ErrorShape > | null ;
592547 targetValue ?: Record < string , FormValue > | null ;
593- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
594- value ?: Record < string , FormValue > | null ;
595548 hideFields ?: string [ ] ;
596549 reset ?: boolean ;
597550 } ,
@@ -605,8 +558,6 @@ export function report<ErrorShape>(
605558 keepFiles : true ;
606559 error : CustomError < ErrorShape > | null ;
607560 targetValue ?: Record < string , FormValue > | null ;
608- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
609- value ?: Record < string , FormValue > | null ;
610561 hideFields ?: string [ ] ;
611562 reset ?: boolean ;
612563 } ,
@@ -617,8 +568,6 @@ export function report(
617568 keepFiles ?: false ;
618569 error : StandardSchemaError ;
619570 targetValue ?: Record < string , FormValue > | null ;
620- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
621- value ?: Record < string , FormValue > | null ;
622571 hideFields ?: string [ ] ;
623572 reset ?: boolean ;
624573 } ,
@@ -632,8 +581,6 @@ export function report(
632581 keepFiles : true ;
633582 error : StandardSchemaError ;
634583 targetValue ?: Record < string , FormValue > | null ;
635- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
636- value ?: Record < string , FormValue > | null ;
637584 hideFields ?: string [ ] ;
638585 reset ?: boolean ;
639586 } ,
@@ -644,8 +591,6 @@ export function report<ErrorShape>(
644591 keepFiles ?: boolean ;
645592 error ?: CustomError < ErrorShape > | null ;
646593 targetValue ?: Record < string , FormValue > | null ;
647- /** @deprecated Use `targetValue` instead. This will be removed in the next minor release. */
648- value ?: Record < string , FormValue > | null ;
649594 hideFields ?: string [ ] ;
650595 reset ?: boolean ;
651596 } ,
@@ -668,10 +613,6 @@ export function report<ErrorShape>(
668613 * to a specific value when combined with `reset: true`.
669614 */
670615 targetValue ?: Record < string , FormValue > | null ;
671- /**
672- * @deprecated Use `targetValue` instead. This will be removed in the next minor release.
673- */
674- value ?: Record < string , FormValue > | null ;
675616 /**
676617 * Array of field names to hide from the result by setting them to `undefined`.
677618 * Primarily used for sensitive data like passwords that should not be sent back to the client.
@@ -693,15 +634,13 @@ export function report<ErrorShape>(
693634 error = normalizeFormError ( options . error ) ;
694635 }
695636
696- const targetValueOption =
697- 'targetValue' in options ? options . targetValue : options . value ;
698637 const targetValue =
699- typeof targetValueOption === 'undefined' ||
700- ( submission . payload === targetValueOption && ! options . reset )
638+ typeof options . targetValue === 'undefined' ||
639+ ( submission . payload === options . targetValue && ! options . reset )
701640 ? undefined
702- : targetValueOption && ! options . keepFiles
703- ? stripFiles ( targetValueOption )
704- : ( targetValueOption ?? { } ) ;
641+ : options . targetValue && ! options . keepFiles
642+ ? stripFiles ( options . targetValue )
643+ : ( options . targetValue ?? { } ) ;
705644
706645 if ( options . hideFields ) {
707646 for ( const name of options . hideFields ) {
0 commit comments