Enforce front project structure through ESLINT (#7863)
Fixes: https://github.com/twentyhq/twenty/issues/7329
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
import {
|
||||
Workflow,
|
||||
WorkflowVersion,
|
||||
WorkflowWithCurrentVersion,
|
||||
} from '@/workflow/types/Workflow';
|
||||
import { isDefined } from 'twenty-ui';
|
||||
|
||||
// eslint-disable-next-line prefer-arrow/prefer-arrow-functions
|
||||
export function assertWorkflowWithCurrentVersionIsDefined(
|
||||
workflow: WorkflowWithCurrentVersion | undefined,
|
||||
): asserts workflow is Workflow & { currentVersion: WorkflowVersion } {
|
||||
if (!isDefined(workflow) || !isDefined(workflow.currentVersion)) {
|
||||
throw new Error('Expected workflow and its current version to be defined');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user