video-comments.ts 490 B

12345678910111213141516
  1. import 'express-validator'
  2. import 'multer'
  3. import * as validator from 'validator'
  4. import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
  5. const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS
  6. function isValidVideoCommentText (value: string) {
  7. return value === null || validator.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT)
  8. }
  9. // ---------------------------------------------------------------------------
  10. export {
  11. isValidVideoCommentText
  12. }