diff options
Diffstat (limited to 'apps/settings/src/utils/validate.js')
-rw-r--r-- | apps/settings/src/utils/validate.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/settings/src/utils/validate.js b/apps/settings/src/utils/validate.js index a0edb87dfa8..f7371301909 100644 --- a/apps/settings/src/utils/validate.js +++ b/apps/settings/src/utils/validate.js @@ -29,12 +29,14 @@ import { VALIDATE_EMAIL_REGEX } from '../constants/AccountPropertyConstants' /** - * Validate the display name input + * Validate the string input + * + * *Generic validator just to check that input is not an empty string* * * @param {string} input the input * @returns {boolean} */ -export function validateDisplayName(input) { +export function validateStringInput(input) { return input !== '' } @@ -67,3 +69,13 @@ export function validateLanguage(input) { && input.name !== '' && input.name !== undefined } + +/** + * Validate boolean input + * + * @param {boolean} input the input + * @returns {boolean} + */ +export function validateBoolean(input) { + return typeof input === 'boolean' +} |