File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
src/routes/tests/issue-298 Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change 22 import { z } from ' zod' ;
33 import { superForm as _superForm } from ' $lib/client' ;
44 import { superValidateSync } from ' $lib/client' ;
5- import SuperDebug from ' $lib/client/SuperDebug.svelte' ;
65
76 function ruleSet<T extends readonly [string , ... string []]>(options : T ) {
87 let prev: string | undefined = undefined ;
1413 })
1514 .transform ((value ) => {
1615 const output = { ... value , prev: prev };
17- prev = current ;
18- current = value .options as string ;
16+ if (value .options != current ) {
17+ prev = current ;
18+ current = value .options as string ;
19+ }
1920 return output ;
2021 });
2122 }
2829 r2: ruleSet (r2 )
2930 });
3031
31- type T = z .infer <typeof schema >;
32-
3332 const superForm = _superForm (superValidateSync (schema ), {
3433 SPA: true ,
3534 dataType: ' json' ,
4039 $ : ({ form } = superForm );
4140 </script >
4241
43- <SuperDebug data ={$form } />
42+ <h4 >
43+ {$form .r1 .options }-{$form .r1 .prev } / {$form .r2 .options }-{$form .r2 .prev }
44+ </h4 >
4445
4546<form use:superForm .enhance method =" post" >
4647 {#each r1 as item }
You can’t perform that action at this time.
0 commit comments