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

15 lines
453 B
TypeScript
Raw Normal View History

2020-01-07 07:56:07 -06:00
import validator from 'validator'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants.js'
2017-12-22 03:50:07 -06:00
const VIDEO_COMMENTS_CONSTRAINTS_FIELDS = CONSTRAINTS_FIELDS.VIDEO_COMMENTS
function isValidVideoCommentText (value: string) {
return value === null || validator.default.isLength(value, VIDEO_COMMENTS_CONSTRAINTS_FIELDS.TEXT)
2017-12-22 03:50:07 -06:00
}
// ---------------------------------------------------------------------------
export {
isValidVideoCommentText
2017-12-22 03:50:07 -06:00
}