mirror of
https://github.com/theoludwig/p61-project.git
synced 2024-07-17 07:00:12 +02:00
8 lines
187 B
TypeScript
8 lines
187 B
TypeScript
import type { ZodError } from "zod"
|
|
|
|
export const getErrorsFieldsFromZodError = <T>(
|
|
error: ZodError<T>,
|
|
): Array<keyof T> => {
|
|
return Object.keys(error.format()) as Array<keyof T>
|
|
}
|