Skip to content

Commit

Permalink
feat: mandate uniq versions
Browse files Browse the repository at this point in the history
  • Loading branch information
zkrising committed May 9, 2024
1 parent 43c5183 commit 10fda7c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ const PR_CHART_DOCUMENT = (game: Game) => (self: unknown) => {

versions: (self) => {
if (!Array.isArray(self)) {
return "Expected an array.";
return "Expected an array";
}

const versions = Object.keys(gptConfig.versions);
Expand All @@ -267,6 +267,10 @@ const PR_CHART_DOCUMENT = (game: Game) => (self: unknown) => {
return "Versions array should not be empty as this game uses versions";
}

if (new Set(...self).size !== self.length) {
return "Versions array shouldn't contain the same version twice";
}

return true;
},
})(self);
Expand Down

0 comments on commit 10fda7c

Please sign in to comment.