4 var validator
= require('validator')
6 var customValidators
= {
7 eachIsRemoteVideosAddValid: eachIsRemoteVideosAddValid
,
8 eachIsRemoteVideosRemoveValid: eachIsRemoteVideosRemoveValid
,
12 function eachIsRemoteVideosAddValid (values
) {
13 return values
.every(function (val
) {
14 return validator
.isLength(val
.name
, 1, 50) &&
15 validator
.isLength(val
.description
, 1, 50) &&
16 validator
.isLength(val
.magnetUri
, 10) &&
17 validator
.isURL(val
.podUrl
)
21 function eachIsRemoteVideosRemoveValid (values
) {
22 return values
.every(function (val
) {
23 return validator
.isLength(val
.magnetUri
, 10)
27 function isArray (value
) {
28 return Array
.isArray(value
)
31 // ---------------------------------------------------------------------------
33 module
.exports
= customValidators