Skip to content

Commit

Permalink
fix: check sets size correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
Hervé Huneau committed Feb 19, 2019
1 parent 77f9d9f commit e8168b5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@ module.exports = {
assert(getSets()[set] !== undefined || set === "RNG", `set ${set} is invalid or does not exist`));
if ("sealed" === type) {
assert(typeof fourPack === "boolean", "fourPack must be a boolean");
assert(!fourPack || sets.length < 4, "sets must be at least 4");
const minPacks = fourPack ? 4 : 6;
assert(sets.length >= minPacks, `sets must be at least ${minPacks}`);
} else {
assert(sets.length == 3, "sets length must be 3");
}
Expand Down

0 comments on commit e8168b5

Please sign in to comment.