From cef534ed53e4518fe0acf581bfe880788d42fc36 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Dec 2018 10:36:24 +0100 Subject: Add user notification base code --- server/helpers/custom-validators/misc.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'server/helpers/custom-validators/misc.ts') diff --git a/server/helpers/custom-validators/misc.ts b/server/helpers/custom-validators/misc.ts index 6d10a65a8..a093e3e1b 100644 --- a/server/helpers/custom-validators/misc.ts +++ b/server/helpers/custom-validators/misc.ts @@ -9,6 +9,10 @@ function isArray (value: any) { return Array.isArray(value) } +function isIntArray (value: any) { + return Array.isArray(value) && value.every(v => validator.isInt('' + v)) +} + function isDateValid (value: string) { return exists(value) && validator.isISO8601(value) } @@ -78,6 +82,7 @@ function isFileValid ( export { exists, + isIntArray, isArray, isIdValid, isUUIDValid, -- cgit v1.2.3