@@ -1301,37 +1301,37 @@ export function superForm<
13011301 //console.log('newTainted:', JSON.stringify(newTainted));
13021302
13031303 if ( paths . length ) {
1304- if ( taintOptions == 'untaint-all' || taintOptions == 'untaint-form' ) {
1305- Tainted . state . set ( undefined ) ;
1306- } else {
1307- Tainted . state . update ( ( currentlyTainted ) => {
1308- if ( ! currentlyTainted ) currentlyTainted = { } ;
1309-
1310- setPaths ( currentlyTainted , paths , ( path , data ) => {
1311- // If value goes back to the clean value, untaint the path
1312- if ( ! newTainted . includes ( path . join ( ) ) ) return undefined ;
1313-
1314- const currentValue = traversePath ( newData , path ) ;
1315- const cleanPath = traversePath ( Tainted . clean , path ) ;
1316- const identical = currentValue && cleanPath && currentValue . value === cleanPath . value ;
1317-
1318- const output = identical
1319- ? undefined
1320- : taintOptions === true
1321- ? true
1322- : taintOptions === 'untaint'
1323- ? undefined
1324- : data . value ;
1325-
1326- return output ;
1327- } ) ;
1328-
1329- return currentlyTainted ;
1304+ Tainted . state . update ( ( currentlyTainted ) => {
1305+ if ( ! currentlyTainted ) currentlyTainted = { } ;
1306+
1307+ setPaths ( currentlyTainted , paths , ( path , data ) => {
1308+ // If value goes back to the clean value, untaint the path
1309+ if ( ! newTainted . includes ( path . join ( ) ) ) return undefined ;
1310+
1311+ const currentValue = traversePath ( newData , path ) ;
1312+ const cleanPath = traversePath ( Tainted . clean , path ) ;
1313+ const identical = currentValue && cleanPath && currentValue . value === cleanPath . value ;
1314+
1315+ const output = identical
1316+ ? undefined
1317+ : taintOptions === true
1318+ ? true
1319+ : taintOptions === 'untaint'
1320+ ? undefined
1321+ : data . value ;
1322+
1323+ return output ;
13301324 } ) ;
1331- }
1325+
1326+ return currentlyTainted ;
1327+ } ) ;
13321328
13331329 NextChange_setHtmlEvent ( { paths } ) ;
13341330 }
1331+
1332+ if ( taintOptions == 'untaint-all' || taintOptions == 'untaint-form' ) {
1333+ Tainted . state . set ( undefined ) ;
1334+ }
13351335 }
13361336
13371337 /**
0 commit comments