From 5c4236255f2bd4828960d1048482797e62c0fa68 Mon Sep 17 00:00:00 2001 From: Thomas Bouffard <27200110+tbouffard@users.noreply.github.com> Date: Fri, 13 Oct 2023 08:11:12 +0200 Subject: [PATCH] Simplify ShapeUtil.isCatchEvent method (only return boolean) --- src/component/parser/json/converter/ProcessConverter.ts | 4 ++-- src/model/bpmn/internal/shape/utils.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/component/parser/json/converter/ProcessConverter.ts b/src/component/parser/json/converter/ProcessConverter.ts index 228048d7bf..b6d85bb1ff 100644 --- a/src/component/parser/json/converter/ProcessConverter.ts +++ b/src/component/parser/json/converter/ProcessConverter.ts @@ -288,7 +288,7 @@ export default class ProcessConverter { private buildShapeBpmnCatchEvent( bpmnElement: TCatchEvent, - elementKind: ShapeBpmnElementKind.EVENT_BOUNDARY | ShapeBpmnElementKind.EVENT_START | ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH, + elementKind: BpmnEventKind, eventDefinitionKind: ShapeBpmnEventDefinitionKind, parentId: string, ): ShapeBpmnIntermediateCatchEvent | ShapeBpmnStartEvent | ShapeBpmnBoundaryEvent { @@ -303,7 +303,7 @@ export default class ProcessConverter { private buildShapeBpmnThrowEvent( bpmnElement: TThrowEvent, - elementKind: ShapeBpmnElementKind.EVENT_END | ShapeBpmnElementKind.EVENT_INTERMEDIATE_THROW, + elementKind: BpmnEventKind, eventDefinitionKind: ShapeBpmnEventDefinitionKind, parentId: string, ): ShapeBpmnIntermediateThrowEvent | ShapeBpmnEvent { diff --git a/src/model/bpmn/internal/shape/utils.ts b/src/model/bpmn/internal/shape/utils.ts index cb5dc40ef9..2d782df457 100644 --- a/src/model/bpmn/internal/shape/utils.ts +++ b/src/model/bpmn/internal/shape/utils.ts @@ -45,7 +45,7 @@ export class ShapeUtil { return ShapeBpmnElementKind.EVENT_START === kind; } - static isCatchEvent(kind: ShapeBpmnElementKind): kind is ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH | ShapeBpmnElementKind.EVENT_BOUNDARY | ShapeBpmnElementKind.EVENT_START { + static isCatchEvent(kind: ShapeBpmnElementKind): boolean { return ShapeBpmnElementKind.EVENT_INTERMEDIATE_CATCH === kind || ShapeBpmnElementKind.EVENT_BOUNDARY === kind || ShapeBpmnElementKind.EVENT_START === kind; }