mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2025-10-05 19:42:24 +02:00
New directory organization
This commit is contained in:
parent
86435b9bae
commit
cda021079f
40 changed files with 40 additions and 41 deletions
29
helpers/customValidators.js
Normal file
29
helpers/customValidators.js
Normal file
|
@ -0,0 +1,29 @@
|
|||
;(function () {
|
||||
'use strict'
|
||||
|
||||
var validator = require('validator')
|
||||
|
||||
var customValidators = {}
|
||||
|
||||
customValidators.eachIsRemoteVideosAddValid = function (values) {
|
||||
return values.every(function (val) {
|
||||
return validator.isLength(val.name, 1, 50) &&
|
||||
validator.isLength(val.description, 1, 50) &&
|
||||
validator.isLength(val.magnetUri, 10) &&
|
||||
validator.isURL(val.podUrl)
|
||||
})
|
||||
}
|
||||
|
||||
customValidators.eachIsRemoteVideosRemoveValid = function (values) {
|
||||
return values.every(function (val) {
|
||||
return validator.isLength(val.magnetUri, 10)
|
||||
})
|
||||
}
|
||||
|
||||
customValidators.isArray = function (value) {
|
||||
return Array.isArray(value)
|
||||
}
|
||||
|
||||
// ----------- Export -----------
|
||||
module.exports = customValidators
|
||||
})()
|
Loading…
Add table
Add a link
Reference in a new issue