1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-22 14:59:41 +02:00
portainer/app/react/docker/stacks/view-models/utils.ts

20 lines
633 B
TypeScript

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;
}