Commit 765f2bb933eab0848a77fff44ca951dab76ad465
1 parent
407b4f44
Exists in
master
and in
1 other branch
Refactoring the source code of endpoints files
Showing
1 changed file
with
10 additions
and
20 deletions
Show diff stats
helpers/parameters.js
| @@ -89,11 +89,9 @@ function checkServiceType(service_type) { | @@ -89,11 +89,9 @@ function checkServiceType(service_type) { | ||
| 89 | if (service_type === t_types[i]) { | 89 | if (service_type === t_types[i]) { |
| 90 | return true; | 90 | return true; |
| 91 | } | 91 | } |
| 92 | - | ||
| 93 | - if ((i + 1) === t_types.length) { | ||
| 94 | - return false; | ||
| 95 | - } | ||
| 96 | } | 92 | } |
| 93 | + | ||
| 94 | + return false; | ||
| 97 | }; | 95 | }; |
| 98 | 96 | ||
| 99 | function checkLanguage(language) { | 97 | function checkLanguage(language) { |
| @@ -103,11 +101,9 @@ function checkLanguage(language) { | @@ -103,11 +101,9 @@ function checkLanguage(language) { | ||
| 103 | if (language === t_types[i]) { | 101 | if (language === t_types[i]) { |
| 104 | return true; | 102 | return true; |
| 105 | } | 103 | } |
| 106 | - | ||
| 107 | - if ((i + 1) === t_types.length) { | ||
| 108 | - return false; | ||
| 109 | - } | ||
| 110 | } | 104 | } |
| 105 | + | ||
| 106 | + return false; | ||
| 111 | }; | 107 | }; |
| 112 | 108 | ||
| 113 | function checkPosition(position) { | 109 | function checkPosition(position) { |
| @@ -117,11 +113,9 @@ function checkPosition(position) { | @@ -117,11 +113,9 @@ function checkPosition(position) { | ||
| 117 | if (position === t_types[i]) { | 113 | if (position === t_types[i]) { |
| 118 | return true; | 114 | return true; |
| 119 | } | 115 | } |
| 120 | - | ||
| 121 | - if ((i + 1) === t_types.length) { | ||
| 122 | - return false; | ||
| 123 | - } | ||
| 124 | } | 116 | } |
| 117 | + | ||
| 118 | + return false; | ||
| 125 | }; | 119 | }; |
| 126 | 120 | ||
| 127 | function checkSize(size) { | 121 | function checkSize(size) { |
| @@ -131,11 +125,9 @@ function checkSize(size) { | @@ -131,11 +125,9 @@ function checkSize(size) { | ||
| 131 | if (size === t_types[i]) { | 125 | if (size === t_types[i]) { |
| 132 | return true; | 126 | return true; |
| 133 | } | 127 | } |
| 134 | - | ||
| 135 | - if ((i + 1) === t_types.length) { | ||
| 136 | - return false; | ||
| 137 | - } | ||
| 138 | } | 128 | } |
| 129 | + | ||
| 130 | + return false; | ||
| 139 | }; | 131 | }; |
| 140 | 132 | ||
| 141 | function checkTransparency(transparency) { | 133 | function checkTransparency(transparency) { |
| @@ -145,11 +137,9 @@ function checkTransparency(transparency) { | @@ -145,11 +137,9 @@ function checkTransparency(transparency) { | ||
| 145 | if (transparency === t_types[i]) { | 137 | if (transparency === t_types[i]) { |
| 146 | return true; | 138 | return true; |
| 147 | } | 139 | } |
| 148 | - | ||
| 149 | - if ((i + 1) === t_types.length) { | ||
| 150 | - return false; | ||
| 151 | - } | ||
| 152 | } | 140 | } |
| 141 | + | ||
| 142 | + return false; | ||
| 153 | }; | 143 | }; |
| 154 | 144 | ||
| 155 | function checkVideo(file) { | 145 | function checkVideo(file) { |