aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/misc.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts
index f8f168149..c19a3e5eb 100644
--- a/server/helpers/custom-validators/misc.ts
+++ b/server/helpers/custom-validators/misc.ts
@@ -23,6 +23,10 @@ function isNotEmptyIntArray (value: any) {
23 return Array.isArray(value) && value.every(v => validator.isInt('' + v)) && value.length !== 0 23 return Array.isArray(value) && value.every(v => validator.isInt('' + v)) && value.length !== 0
24} 24}
25 25
26function isNotEmptyStringArray (value: any) {
27 return Array.isArray(value) && value.every(v => typeof v === 'string' && v.length !== 0) && value.length !== 0
28}
29
26function isArrayOf (value: any, validator: (value: any) => boolean) { 30function isArrayOf (value: any, validator: (value: any) => boolean) {
27 return isArray(value) && value.every(v => validator(v)) 31 return isArray(value) && value.every(v => validator(v))
28} 32}
@@ -187,6 +191,7 @@ export {
187 isIntOrNull, 191 isIntOrNull,
188 isIdValid, 192 isIdValid,
189 isSafePath, 193 isSafePath,
194 isNotEmptyStringArray,
190 isUUIDValid, 195 isUUIDValid,
191 toCompleteUUIDs, 196 toCompleteUUIDs,
192 toCompleteUUID, 197 toCompleteUUID,