import { FormikErrors } from 'formik'; export function isErrorType( error: string | FormikErrors | undefined ): error is FormikErrors { return error !== undefined && typeof error !== 'string'; } export function isArrayErrorType( error: | string[] | FormikErrors[] | string | undefined | (FormikErrors | undefined)[] ): error is FormikErrors[] { return error !== undefined && typeof error !== 'string'; }