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/video-comments.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/server/helpers/custom-validators/video-comments.ts b/server/helpers/custom-validators/video-comments.ts
new file mode 100644
index 000000000..2b3f66063
--- /dev/null
+++ b/server/helpers/custom-validators/video-comments.ts
@@ -0,0 +1,16 @@
1import 'express-validator'
2import 'multer'
3import * as validator from 'validator'
4import { CONSTRAINTS_FIELDS } from '../../initializers'
5
6const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS
7
8function isValidVideoCommentText (value: string) {
9 return value === null || validator.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT)
10}
11
12// ---------------------------------------------------------------------------
13
14export {
15 isValidVideoCommentText
16}