diff --git a/src/verifyAndStoreOptionValue.ts b/src/verifyAndStoreOptionValue.ts index b69f127..c341cf0 100644 --- a/src/verifyAndStoreOptionValue.ts +++ b/src/verifyAndStoreOptionValue.ts @@ -10,6 +10,10 @@ function execWithCustomError(func: (...args: any[]) => any, showError: (error: E } } +/** + * Verifies that the given value is a valid value for this option, and throws an error otherwise. + * Also updates state variables if the value is correct. + */ export default function verifyAndStoreOptionValue({ option, value, @@ -24,7 +28,7 @@ export default function verifyAndStoreOptionValue({ message: IOption['message'], outputArgs: IState['outputArgs'], requiredOptions: IState['requiredOptions'], -}) { +}): void { //Verify value for correctness const verifyValue = execWithCustomError(verify.bind(null, value), (error) => `Invalid value set for option "${option}", the validation of "${value}" failed: ${String(error)}`); if (verifyValue !== true) {