1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2025-05-18 12:02:53 +02:00

fix(cli): remove duplicate solutions to test

This commit is contained in:
Divlo
2021-11-30 17:13:37 +01:00
parent 6d30c3defe
commit 88acd8cfef

View File

@ -114,6 +114,15 @@ export class GitAffected implements GitAffectedOptions {
solutions.push(...solutionsByChallenge) solutions.push(...solutionsByChallenge)
} }
} }
return solutions const solutionsUnique: Solution[] = []
for (const solution of solutions) {
const isAlreadyIncluded = solutionsUnique.some((solutionUnique) => {
return solutionUnique.path === solution.path
})
if (!isAlreadyIncluded) {
solutionsUnique.push(solution)
}
}
return solutionsUnique
} }
} }