1
0
Fork 0
peertube/server/helpers/custom-validators/video-comments.ts
2017-12-22 11:29:12 +01:00

16 lines
480 B
TypeScript

import 'express-validator'
import 'multer'
import * as validator from 'validator'
import { CONSTRAINTS_FIELDS } from '../../initializers'
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
}