You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/react/docker/stacks/view-models/utils.ts

21 lines
633 B

import { ExternalStackViewModel } from './external-stack';
import { StackViewModel } from './stack';
export function isExternalStack(
stack: StackViewModel | ExternalStackViewModel
): stack is ExternalStackViewModel {
return 'External' in stack && stack.External;
}
export function isRegularStack(
stack: StackViewModel | ExternalStackViewModel
): stack is StackViewModel & { Regular: true } {
return 'Regular' in stack && stack.Regular;
}
export function isOrphanedStack(
stack: StackViewModel | ExternalStackViewModel
): stack is StackViewModel & { Orphaned: true } {
return 'Orphaned' in stack && stack.Orphaned;
}