Skip to content

Commit

Permalink
use assert
Browse files Browse the repository at this point in the history
  • Loading branch information
kshen0 committed Sep 12, 2023
1 parent 368e2a5 commit 723c854
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,13 +376,8 @@ export function buildMachine(
{
id: 'printBallot',
src: (context, event) => {
// Need to hint to Typescript that we want the 'VOTER_INITIATED_PRINT' event in our union type of events
if ('pdfData' in event) {
return driverPrintBallot(context.driver, event.pdfData, {});
}
throw new Error(
`printing_ballot entry called by unsupported event type: ${event.type}`
);
assert(event.type === 'VOTER_INITIATED_PRINT');
return driverPrintBallot(context.driver, event.pdfData, {});
},
onDone: {
target: 'scanning',
Expand Down

0 comments on commit 723c854

Please sign in to comment.