Remove exception on invalid input

This commit is contained in:
Florine W. Dekker 2022-12-14 11:25:10 +01:00
parent 3cc6350803
commit 9eda7eeaf6
Signed by: FWDekker
GPG Key ID: D3DCFAA8A4560BE0
3 changed files with 8 additions and 8 deletions

BIN
package-lock.json generated

Binary file not shown.

View File

@ -1,6 +1,6 @@
{ {
"name": "doomsday", "name": "doomsday",
"version": "1.5.2", "version": "1.5.3",
"description": "Test your mastery of Conway's Doomsday rule.", "description": "Test your mastery of Conway's Doomsday rule.",
"author": "Florine W. Dekker", "author": "Florine W. Dekker",
"browser": "dist/bundle.js", "browser": "dist/bundle.js",
@ -29,7 +29,7 @@
"grunt-text-replace": "^0.4.0", "grunt-text-replace": "^0.4.0",
"grunt-webpack": "^5.0.0", "grunt-webpack": "^5.0.0",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^4.9.3", "typescript": "^4.9.4",
"webpack": "^5.75.0", "webpack": "^5.75.0",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.1"
} }

View File

@ -75,31 +75,31 @@ class ValidatableInput {
/** /**
* Returns `true` if and only if the input is valid. * Returns `true` if and only if the input is valid.
* *
* This method **must** be implemented by subclasses. * Returns `false` by default. Implement this method to make it do something else.
* *
* @param value the value of the input to validate * @param value the value of the input to validate
* @return `true` if and only if the input is valid * @return `true` if and only if the input is valid
*/ */
isValid(value: string): boolean { isValid(value: string): boolean {
throw new Error("Implement this method."); return false;
} }
/** /**
* Runs when the user submits a valid input. * Runs when the user submits a valid input.
* *
* This method **must** be implemented by subclasses. * Does nothing by default. Implement this method to make it do something.
*/ */
onValidInput(): void { onValidInput(): void {
throw new Error("Implement this method."); // Do nothing
} }
/** /**
* Runs when a user submits an invalid input. * Runs when a user submits an invalid input.
* *
* This method **must** be implemented by subclasses. * Does nothing by default. Implement this method to make it do something.
*/ */
onInvalidInput(): void { onInvalidInput(): void {
throw new Error("Implement this method."); // Do nothing
} }