Skip to content

Commit

Permalink
fix: workaround for attempted murder
Browse files Browse the repository at this point in the history
that'll teach me to assume a fucking thing about anything!
  • Loading branch information
zkrising committed Jun 11, 2024
1 parent 7b6f4b5 commit 40c7211
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions common/src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,16 @@ const PR_CHART_DOCUMENT = (game: Game) => (self: unknown) => {
return "Array contained invalid versions";
}

const gameUsesVersions = versions.length > 0;

if (gameUsesVersions && self.length === 0) {
return "Versions array should not be empty as this game uses versions";
}
// yeah, so versions array *shouldn't* be empty, and yet we've ended up
// in a real, unignorable situation in which a chart has no versions.
//
// just allow this, for now.

// const gameUsesVersions = versions.length > 0;
//
// if (gameUsesVersions && self.length === 0) {
// 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";
Expand Down

0 comments on commit 40c7211

Please sign in to comment.