Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/core/operations/GenerateDeBruijnSequence.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ class GenerateDeBruijnSequence extends Operation {
throw new OperationError("Invalid alphabet size, required to be between 2 and 9 (inclusive).");
}

if (!Number.isInteger(k)) {
throw new OperationError("Invalid alphabet size, required to be integer.");
}

Comment on lines +53 to +56
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need a similar test / error for n not being an integer

if (!Number.isInteger(n)) {
throw new OperationError("Invalid key length, required to be integer.");
}

if (n < 2) {
throw new OperationError("Invalid key length, required to be at least 2.");
}
Expand Down