summaryrefslogtreecommitdiffstats
path: root/apps/settings/src/utils
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2021-10-14 08:28:54 +0000
committerChristopher Ng <chrng8@gmail.com>2021-10-19 04:59:36 +0000
commit3be9d3ca8fca4fb743a4d2f2ffe44a45fa9ffa6e (patch)
tree5519fb218db5daa3d0e16198f600d5646f7d0b1a /apps/settings/src/utils
parent309354852f12ae88d5eef05d311d6ebcba8ee762 (diff)
downloadnextcloud-server-3be9d3ca8fca4fb743a4d2f2ffe44a45fa9ffa6e.tar.gz
nextcloud-server-3be9d3ca8fca4fb743a4d2f2ffe44a45fa9ffa6e.zip
Profile frontend
Signed-off-by: Christopher Ng <chrng8@gmail.com> Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
Diffstat (limited to 'apps/settings/src/utils')
-rw-r--r--apps/settings/src/utils/validate.js16
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'
+}