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/services/ItemView/TasksDatatable/meta.ts

18 lines
368 B

type TableMeta = {
serviceName: string;
table: 'tasks';
};
export function getTableMeta(meta: unknown): TableMeta {
return isTableMeta(meta) ? meta : { table: 'tasks', serviceName: '' };
}
function isTableMeta(meta: unknown): meta is TableMeta {
return (
!!meta &&
typeof meta === 'object' &&
'table' in meta &&
meta.table === 'tasks'
);
}