Skip to content

Commit

Permalink
Simplify ShapeUtil.isCatchEvent method (only return boolean)
Browse files Browse the repository at this point in the history
  • Loading branch information
tbouffard committed Oct 13, 2023
1 parent 7256178 commit 5c42362
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/component/parser/json/converter/ProcessConverter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/model/bpmn/internal/shape/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 5c42362

Please sign in to comment.