fix for number input, new integer input
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -40,6 +40,13 @@ export class TypeValidation {
|
||||
return Promise.resolve (String (value));
|
||||
|
||||
if (this.option_type === 'number') {
|
||||
const as_num = parseFloat (String (value));
|
||||
if (isNaN (as_num))
|
||||
throw new Error ('value is not a number');
|
||||
return Promise.resolve (as_num);
|
||||
}
|
||||
|
||||
if (this.option_type === 'int') {
|
||||
const as_num = parseInt (String (value));
|
||||
if (isNaN (as_num))
|
||||
throw new Error ('value is not a number');
|
||||
|
Reference in New Issue
Block a user