Skip to content

Commit

Permalink
refactor: 🧑‍💻 AD_HOC not subject to drawTypeCoercion
Browse files Browse the repository at this point in the history
  • Loading branch information
CourtHive committed Apr 16, 2024
1 parent 9a5f7b2 commit e64705c
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { decorateResult } from '@Functions/global/decorateResult';
import { ensureInt } from '@Tools/ensureInt';

// constants and types
import { MULTI_STRUCTURE_DRAWS, SINGLE_ELIMINATION } from '@Constants/drawDefinitionConstants';
import { AD_HOC, MULTI_STRUCTURE_DRAWS, SINGLE_ELIMINATION } from '@Constants/drawDefinitionConstants';
import { INVALID_DRAW_SIZE } from '@Constants/errorConditionConstants';
import { DrawTypeUnion } from '@Types/tournamentTypes';
import { ResultType } from '@Types/factoryTypes';
Expand All @@ -13,6 +13,7 @@ export function getCoercedDrawType(params): ResultType & { drawType: DrawTypeUni

let drawType =
(drawTypeCoercion &&
params.drawType !== AD_HOC &&
(typeof drawTypeCoercion === 'boolean' || drawTypeCoercion <= 2) &&
drawSize === 2 &&
SINGLE_ELIMINATION) ||
Expand Down

0 comments on commit e64705c

Please sign in to comment.