Skip to content

Commit

Permalink
chapter 02: worsen the genericEncoder adding a case for yaml format
Browse files Browse the repository at this point in the history
  • Loading branch information
devcorpio committed Mar 30, 2019
1 parent 8de78eb commit 0ac5c23
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions chapter-02-the-open-closed-principle/genericEncoder.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ function genericEncoder() {
encoder = new JsonEncoder();
} else if (format === 'xml') {
encoder = new XmlEncoder();
} else if (format === 'yml') {
encoder = new YmlEncoder();
} else {
throw new Error('Unknown format');
}
Expand Down

0 comments on commit 0ac5c23

Please sign in to comment.