Skip to content

Commit d2d7501

Browse files
committed
Arktype schema type fix
1 parent 995a5fc commit d2d7501

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

src/lib/adapters/arktype.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { Type } from 'arktype';
1+
import type { type } from 'arktype';
22
import {
33
type ValidationAdapter,
44
type RequiredDefaultsOptions,
@@ -18,7 +18,7 @@ async function modules() {
1818

1919
const fetchModule = /* @__PURE__ */ memoize(modules);
2020

21-
async function _validate<T extends Type>(
21+
async function _validate<T extends type.Any>(
2222
schema: T,
2323
data: unknown
2424
): Promise<ValidationResult<Infer<T>>> {
@@ -40,7 +40,7 @@ async function _validate<T extends Type>(
4040
};
4141
}
4242

43-
function _arktype<T extends Type>(
43+
function _arktype<T extends type.Any>(
4444
schema: T,
4545
options: RequiredDefaultsOptions<Infer<T>>
4646
): ValidationAdapter<Infer<T>, InferIn<T>> {
@@ -52,7 +52,9 @@ function _arktype<T extends Type>(
5252
});
5353
}
5454

55-
function _arktypeClient<T extends Type>(schema: T): ClientValidationAdapter<Infer<T>, InferIn<T>> {
55+
function _arktypeClient<T extends type.Any>(
56+
schema: T
57+
): ClientValidationAdapter<Infer<T>, InferIn<T>> {
5658
return {
5759
superFormValidationLibrary: 'arktype',
5860
validate: async (data) => _validate(schema, data)

src/lib/adapters/typeSchema.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { TSchema, Static as Static$1 } from '@sinclair/typebox';
2-
import type { Type } from 'arktype';
2+
import type { type } from 'arktype';
33
import type { AnySchema } from 'joi';
44
import type {
55
Infer as ClassValidatorInfer,
@@ -73,9 +73,9 @@ type ValidationResult<TOutput = any> =
7373
};
7474

7575
interface ArkTypeResolver extends Resolver {
76-
base: Type;
77-
input: this['schema'] extends Type ? this['schema']['inferIn'] : never;
78-
output: this['schema'] extends Type ? this['schema']['infer'] : never;
76+
base: type.Any;
77+
input: this['schema'] extends type.Any ? this['schema']['inferIn'] : never;
78+
output: this['schema'] extends type.Any ? this['schema']['infer'] : never;
7979
}
8080

8181
interface ClassValidatorResolver extends Resolver {

0 commit comments

Comments
 (0)