Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Adds an error if the value is not a number
- * @param {String} customError custom error message, overrides default message
- */
- export function isPositiveInt(customError){
- return (input) => {
- if(! Number.isInteger(input)){
- addToErrors(input, `${input} is not a valid Integer`, customError)
- }
- else if(input < 0){
- addToErrors(input, `${input} is not a positive number`, customError);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement