aboutsummaryrefslogblamecommitdiffhomepage
path: root/server/helpers/custom-validators/video-comments.ts
blob: 0707e2af2638ed5f645966e9f5317d4c25af1d7e (plain) (tree)
1
2
3
4


                                      
                                                                 











                                                                                            
import 'express-validator'
import 'multer'
import * as validator from 'validator'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'

const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS

function isValidVideoCommentText (value: string) {
  return value === null || validator.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT)
}

// ---------------------------------------------------------------------------

export {
  isValidVideoCommentText
}