Skip to content

Commit

Permalink
fix: deckstrings for Twist being rejected
Browse files Browse the repository at this point in the history
  • Loading branch information
beheh committed Jun 28, 2023
1 parent 283a4bc commit a063556
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
### Fixed
- Fixed with Twist format being rejected

## [3.1.0] - 2023-06-27
### Added
Expand Down
6 changes: 4 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ export function encode(deck: DeckDefinition): string {
typeof deck !== "object" ||
(deck.format !== FormatType.FT_WILD &&
deck.format !== FormatType.FT_STANDARD &&
deck.format !== FormatType.FT_CLASSIC) ||
deck.format !== FormatType.FT_CLASSIC &&
deck.format !== FormatType.FT_TWIST) ||
!Array.isArray(deck.heroes) ||
!Array.isArray(deck.cards) ||
(typeof deck.sideboardCards !== "undefined" &&
Expand Down Expand Up @@ -129,7 +130,8 @@ export function decode(deckstring: string): DeckDefinition {
if (
format !== FormatType.FT_WILD &&
format !== FormatType.FT_STANDARD &&
format !== FormatType.FT_CLASSIC
format !== FormatType.FT_CLASSIC &&
format !== FormatType.FT_TWIST
) {
throw new Error(`Unsupported format ${format} in deckstring`);
}
Expand Down

0 comments on commit a063556

Please sign in to comment.