diff options
Diffstat (limited to 'server/server/helpers/custom-validators/video-comments.ts')
-rw-r--r-- | server/server/helpers/custom-validators/video-comments.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/server/server/helpers/custom-validators/video-comments.ts b/server/server/helpers/custom-validators/video-comments.ts new file mode 100644 index 000000000..104583663 --- /dev/null +++ b/server/server/helpers/custom-validators/video-comments.ts | |||
@@ -0,0 +1,14 @@ | |||
1 | import validator from 'validator' | ||
2 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants.js' | ||
3 | |||
4 | const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS | ||
5 | |||
6 | function isValidVideoCommentText (value: string) { | ||
7 | return value === null || validator.default.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT) | ||
8 | } | ||
9 | |||
10 | // --------------------------------------------------------------------------- | ||
11 | |||
12 | export { | ||
13 | isValidVideoCommentText | ||
14 | } | ||