1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-19 21:39:40 +02:00
portainer/app/react/components/form-components/formikUtils.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
455 B
TypeScript
Raw Normal View History

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