Zod config validation (#635)
* Zod WIP * Zod form validation * DynamicForm testing * Fix linting * Delete rasterSource.ts --------- Co-authored-by: philon- <philon-@users.noreply.github.com>
This commit is contained in:
co-authored by
philon-
parent
df036d3904
commit
1cbd98ec53
@@ -1,7 +1,7 @@
|
||||
import { ZodError, ZodSchema } from "zod";
|
||||
import { ZodError, ZodType } from "zod/v4";
|
||||
|
||||
export function validateSchema<T>(
|
||||
schema: ZodSchema<T>,
|
||||
schema: ZodType<T>,
|
||||
data: unknown,
|
||||
): { success: true; data: T } | { success: false; errors: ZodError["issues"] } {
|
||||
const result = schema.safeParse(data);
|
||||
|
||||
Reference in New Issue
Block a user