1
1
mirror of https://github.com/theoludwig/programming-challenges.git synced 2024-12-08 00:45:29 +01: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
No known key found for this signature in database
GPG Key ID: 6F24DA54DA3967CF

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
} }
} }