diff options
author | Chocobozzz <me@florianbigard.com> | 2018-12-26 10:36:24 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-01-09 11:15:15 +0100 |
commit | cef534ed53e4518fe0acf581bfe880788d42fc36 (patch) | |
tree | 115b51ea5136849a2336d44915c7780649f25dc2 /server/helpers/custom-validators/misc.ts | |
parent | 1de1d05f4c61fe059fa5e24e79c92582f0e7e4b3 (diff) | |
download | PeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.tar.gz PeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.tar.zst PeerTube-cef534ed53e4518fe0acf581bfe880788d42fc36.zip |
Add user notification base code
Diffstat (limited to 'server/helpers/custom-validators/misc.ts')
-rw-r--r-- | server/helpers/custom-validators/misc.ts | 5 |
1 files changed, 5 insertions, 0 deletions
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) { | |||
9 | return Array.isArray(value) | 9 | return Array.isArray(value) |
10 | } | 10 | } |
11 | 11 | ||
12 | function isIntArray (value: any) { | ||
13 | return Array.isArray(value) && value.every(v => validator.isInt('' + v)) | ||
14 | } | ||
15 | |||
12 | function isDateValid (value: string) { | 16 | function isDateValid (value: string) { |
13 | return exists(value) && validator.isISO8601(value) | 17 | return exists(value) && validator.isISO8601(value) |
14 | } | 18 | } |
@@ -78,6 +82,7 @@ function isFileValid ( | |||
78 | 82 | ||
79 | export { | 83 | export { |
80 | exists, | 84 | exists, |
85 | isIntArray, | ||
81 | isArray, | 86 | isArray, |
82 | isIdValid, | 87 | isIdValid, |
83 | isUUIDValid, | 88 | isUUIDValid, |