From b033851fb54241bb703f86add025229e68cc6f59 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 29 Jul 2021 10:27:24 +0200 Subject: Search channels against handles and not names --- server/helpers/custom-validators/misc.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/helpers') 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) { return Array.isArray(value) && value.every(v => validator.isInt('' + v)) && value.length !== 0 } +function isNotEmptyStringArray (value: any) { + return Array.isArray(value) && value.every(v => typeof v === 'string' && v.length !== 0) && value.length !== 0 +} + function isArrayOf (value: any, validator: (value: any) => boolean) { return isArray(value) && value.every(v => validator(v)) } @@ -187,6 +191,7 @@ export { isIntOrNull, isIdValid, isSafePath, + isNotEmptyStringArray, isUUIDValid, toCompleteUUIDs, toCompleteUUID, -- cgit v1.2.3