1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Server: reorganize express validators

This commit is contained in:
Chocobozzz 2016-07-31 20:58:43 +02:00
parent e62f6ef741
commit e4c556196d
8 changed files with 100 additions and 52 deletions

View file

@ -0,0 +1,18 @@
'use strict'
const validator = require('express-validator').validator
const constants = require('../../initializers/constants')
const USERS_CONSTRAINTS_FIELDS = constants.CONSTRAINTS_FIELDS.USERS
const usersValidators = {
isUserUsernameValid: isUserUsernameValid
}
function isUserUsernameValid (value) {
return validator.isLength(value, USERS_CONSTRAINTS_FIELDS.USERNAME)
}
// ---------------------------------------------------------------------------
module.exports = usersValidators