aboutsummaryrefslogtreecommitdiffhomepage
path: root/helpers/customValidators.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-02-07 11:23:23 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-02-07 11:23:23 +0100
commit9f10b2928df655c3672d9607e864e667d4bc903a (patch)
tree7743911b974b3a7fb0d4c7cec2a723942466b7f1 /helpers/customValidators.js
parentd7c01e7793d813d804a3b5716d8288f9dcf71a16 (diff)
downloadPeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.gz
PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.tar.zst
PeerTube-9f10b2928df655c3672d9607e864e667d4bc903a.zip
Remove useless anonymous functions of files
Diffstat (limited to 'helpers/customValidators.js')
-rw-r--r--helpers/customValidators.js52
1 files changed, 25 insertions, 27 deletions
diff --git a/helpers/customValidators.js b/helpers/customValidators.js
index c433e5c5d..20c41f5da 100644
--- a/helpers/customValidators.js
+++ b/helpers/customValidators.js
@@ -1,34 +1,32 @@
1;(function () { 1'use strict'
2 'use strict'
3 2
4 var validator = require('validator') 3var validator = require('validator')
5 4
6 var customValidators = { 5var customValidators = {
7 eachIsRemoteVideosAddValid: eachIsRemoteVideosAddValid, 6 eachIsRemoteVideosAddValid: eachIsRemoteVideosAddValid,
8 eachIsRemoteVideosRemoveValid: eachIsRemoteVideosRemoveValid, 7 eachIsRemoteVideosRemoveValid: eachIsRemoteVideosRemoveValid,
9 isArray: isArray 8 isArray: isArray
10 } 9}
11 10
12 function eachIsRemoteVideosAddValid (values) { 11function eachIsRemoteVideosAddValid (values) {
13 return values.every(function (val) { 12 return values.every(function (val) {
14 return validator.isLength(val.name, 1, 50) && 13 return validator.isLength(val.name, 1, 50) &&
15 validator.isLength(val.description, 1, 50) && 14 validator.isLength(val.description, 1, 50) &&
16 validator.isLength(val.magnetUri, 10) && 15 validator.isLength(val.magnetUri, 10) &&
17 validator.isURL(val.podUrl) 16 validator.isURL(val.podUrl)
18 }) 17 })
19 } 18}
20 19
21 function eachIsRemoteVideosRemoveValid (values) { 20function eachIsRemoteVideosRemoveValid (values) {
22 return values.every(function (val) { 21 return values.every(function (val) {
23 return validator.isLength(val.magnetUri, 10) 22 return validator.isLength(val.magnetUri, 10)
24 }) 23 })
25 } 24}
26 25
27 function isArray (value) { 26function isArray (value) {
28 return Array.isArray(value) 27 return Array.isArray(value)
29 } 28}
30 29
31 // --------------------------------------------------------------------------- 30// ---------------------------------------------------------------------------
32 31
33 module.exports = customValidators 32module.exports = customValidators
34})()