mirror of https://github.com/portainer/portainer
19 lines
408 B
TypeScript
19 lines
408 B
TypeScript
import { FormikErrors } from 'formik';
|
|
|
|
export function isServicePortError<T>(
|
|
error: string | FormikErrors<T> | undefined
|
|
): error is FormikErrors<T> {
|
|
return error !== undefined && typeof error !== 'string';
|
|
}
|
|
|
|
export function newPort(serviceName?: string) {
|
|
return {
|
|
port: undefined,
|
|
targetPort: undefined,
|
|
name: '',
|
|
protocol: 'TCP',
|
|
nodePort: undefined,
|
|
serviceName,
|
|
};
|
|
}
|