Commit 28f21f05 authored by Fellipe Capelli's avatar Fellipe Capelli

Update array iteration on checkCredential method

parent 5a282702
...@@ -53,7 +53,7 @@ var basicRequest = function (url, apiKey, method, body, callback) { ...@@ -53,7 +53,7 @@ var basicRequest = function (url, apiKey, method, body, callback) {
* @returns {boolean} * @returns {boolean}
*/ */
var checkCredential = function (credentialName, credential) { var checkCredential = function (credentialName, credential) {
for (var i = 0, credentialLen = ALLOWED_CREDENTIALS.length; i < credentialLen; i++) { for (var i = 0; i < ALLOWED_CREDENTIALS.length; i++) {
if (ALLOWED_CREDENTIALS[i].name === credentialName) { if (ALLOWED_CREDENTIALS[i].name === credentialName) {
if (typeof credential !== ALLOWED_CREDENTIALS[i].type) { if (typeof credential !== ALLOWED_CREDENTIALS[i].type) {
throw credentialName + ' must be a ' + ALLOWED_CREDENTIALS[i].type; throw credentialName + ' must be a ' + ALLOWED_CREDENTIALS[i].type;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment