Commit 5da1d758 authored by Fellipe Capelli's avatar Fellipe Capelli

Update client file with code style used in other files and add editorconfig

parent 8402ed4e
root = true
[*.js]
indent_style = space
end_of_line = lf
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.md]
trim_trailing_whitespace = false
...@@ -13,7 +13,7 @@ var ALLOWED_CREDENTIALS = [ ...@@ -13,7 +13,7 @@ var ALLOWED_CREDENTIALS = [
* make a basic request * make a basic request
* @param url * @param url
* @param apiKey * @param apiKey
* @param method : [ GET, POSt, PUT ...] * @param method : [ GET, POST, PUT ...]
* @param body * @param body
* @param callback (err, httpResponse, body) * @param callback (err, httpResponse, body)
*/ */
...@@ -52,7 +52,7 @@ var basicRequest = function (url, apiKey, method, body, callback) { ...@@ -52,7 +52,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; i < ALLOWED_CREDENTIALS.length; i++) { for (var i = 0, credentialLen = ALLOWED_CREDENTIALS.length; i < credentialLen; 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;
...@@ -127,7 +127,6 @@ Client.prototype.sendNotification = function (notification, callback) { ...@@ -127,7 +127,6 @@ Client.prototype.sendNotification = function (notification, callback) {
} else { } else {
throw 'You must set either an "app" or "apps" on Client'; throw 'You must set either an "app" or "apps" on Client';
} }
}; };
/** /**
...@@ -308,5 +307,4 @@ Client.prototype.csvExport = function (body, callback) { ...@@ -308,5 +307,4 @@ Client.prototype.csvExport = function (body, callback) {
return basicRequest(csvUri, this.app.appAuthKey, 'POST', body, callback); return basicRequest(csvUri, this.app.appAuthKey, 'POST', body, callback);
}; };
module.exports = Client; module.exports = Client;
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