PeerTube/server/helpers/custom-validators/video-comments.ts

16 lines
463 B
TypeScript
Raw Normal View History

2017-12-22 10:50:07 +01:00
import 'multer'
import * as validator from 'validator'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
2017-12-22 10:50:07 +01:00
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
}