Skip to content

Commit

Permalink
Fix bug of TS
Browse files Browse the repository at this point in the history
  • Loading branch information
fedekrenn committed May 9, 2024
1 parent 40612cf commit f17a252
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/utils/calculateClasification.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { type TABLE_POSITIONS } from '../types/teamPrediction';
import type { TABLE_POSITIONS } from '../types/teamPrediction'

type Clasificacion = {
type PositionTable = {
[key: number]: TABLE_POSITIONS
}

export default function calculateClasification(posicion: number, equipoDesciendePorPromedios: boolean): TABLE_POSITIONS {
export default function calculateClasification(position: number, isTeamRelegatedByAverages: boolean): TABLE_POSITIONS {

if (equipoDesciendePorPromedios) return 'descensoPromedios'
if (isTeamRelegatedByAverages) return 'descensoPromedios'

const clasificacion: Clasificacion = {
const ranking: PositionTable = {
1: 'libertadores',
2: 'libertadores',
3: 'libertadores',
Expand All @@ -21,7 +21,7 @@ export default function calculateClasification(posicion: number, equipoDesciende
28: 'descensoPorTabla'
};

const finalClassification = clasificacion[posicion];
const finalClassification = ranking[position];

return finalClassification ? finalClassification : 'noClasificado';
}

0 comments on commit f17a252

Please sign in to comment.