1
0
Fork 0
peertube/server/helpers/custom-validators/video-comments.ts
2020-01-07 15:56:07 +01:00

15 lines
458 B
TypeScript

import 'multer'
import 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
}