Skip to content

Commit 22fa774

Browse files
committed
fix(types): add generic validate function for adapters
1 parent fff996c commit 22fa774

File tree

1 file changed

+5
-0
lines changed
  • packages/next-safe-action/src/adapters

1 file changed

+5
-0
lines changed

packages/next-safe-action/src/adapters/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ export type ValidationIssue = {
2929
};
3030

3131
export interface ValidationAdapter {
32+
// generic
33+
validate<S extends Schema>(
34+
schema: S,
35+
data: unknown
36+
): Promise<{ success: true; data: Infer<S> } | { success: false; issues: ValidationIssue[] }>;
3237
// zod
3338
validate<S extends z.ZodType>(
3439
schema: S,

0 commit comments

Comments
 (0)