@@ -24,12 +24,12 @@ type AnySchema = Schema.Schema<any, any>;
24
24
async function validate < T extends AnySchema > (
25
25
schema : T ,
26
26
data : unknown ,
27
- options ?: AdapterOptions < Infer < T > > & { parseOptions ?: ParseOptions }
28
- ) : Promise < ValidationResult < Infer < T > > > {
27
+ options ?: AdapterOptions < Infer < T , 'effect' > > & { parseOptions ?: ParseOptions }
28
+ ) : Promise < ValidationResult < Infer < T , 'effect' > > > {
29
29
const result = Schema . decodeUnknownEither ( schema , { errors : 'all' } ) ( data , options ?. parseOptions ) ;
30
30
if ( Either . isRight ( result ) ) {
31
31
return {
32
- data : result . right as Infer < T > ,
32
+ data : result . right as Infer < T , 'effect' > ,
33
33
success : true
34
34
} ;
35
35
}
@@ -40,13 +40,13 @@ async function validate<T extends AnySchema>(
40
40
path : [ ...path ] // path is readonly array so we have to copy it
41
41
} ) ) ,
42
42
success : false
43
- } satisfies ValidationResult < Infer < T > > ;
43
+ } satisfies ValidationResult < Infer < T , 'effect' > > ;
44
44
}
45
45
46
46
function _effect < T extends AnySchema > (
47
47
schema : T ,
48
- options ?: AdapterOptions < Infer < T > > & { parseOptions ?: ParseOptions }
49
- ) : ValidationAdapter < Infer < T > , InferIn < T > > {
48
+ options ?: AdapterOptions < Infer < T , 'effect' > > & { parseOptions ?: ParseOptions }
49
+ ) : ValidationAdapter < Infer < T , 'effect' > , InferIn < T , 'effect' > > {
50
50
return createAdapter ( {
51
51
superFormValidationLibrary : 'effect' ,
52
52
validate : async ( data ) => validate ( schema , data , options ) ,
@@ -57,8 +57,8 @@ function _effect<T extends AnySchema>(
57
57
58
58
function _effectClient < T extends AnySchema > (
59
59
schema : T ,
60
- options ?: AdapterOptions < Infer < T > > & { parseOptions ?: ParseOptions }
61
- ) : ClientValidationAdapter < Infer < T > , InferIn < T > > {
60
+ options ?: AdapterOptions < Infer < T , 'effect' > > & { parseOptions ?: ParseOptions }
61
+ ) : ClientValidationAdapter < Infer < T , 'effect' > , InferIn < T , 'effect' > > {
62
62
return {
63
63
superFormValidationLibrary : 'effect' ,
64
64
validate : async ( data ) => validate ( schema , data , options )
0 commit comments