Skip to content

Commit

Permalink
eslint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aydrian committed Oct 24, 2016
1 parent b55f9c4 commit 1a20aaa
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions lib/inboundDomains.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(client) {
get: function(domain, callback) {
let options;

if(!domain || typeof domain !== 'string') {
if (!domain || typeof domain !== 'string') {
return Promise.reject(new Error('domain is required')).asCallback(callback);
}

Expand All @@ -46,7 +46,7 @@ module.exports = function(client) {
create: function(createOpts, callback) {
let options;

if(!createOpts || typeof createOpts !== 'object') {
if (!createOpts || typeof createOpts !== 'object') {
return Promise.reject(new Error('create options are required')).asCallback(callback);
}

Expand Down
8 changes: 4 additions & 4 deletions lib/relayWebhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(client) {
get: function(id, callback) {
let options;

if(!id || typeof id !== 'string') {
if (!id || typeof id !== 'string') {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

Expand All @@ -46,7 +46,7 @@ module.exports = function(client) {
create: function(webhook, callback) {
let reqOpts;

if(!webhook || typeof webhook !== 'object') {
if (!webhook || typeof webhook !== 'object') {
return Promise.reject(new Error('webhook object is required')).asCallback(callback);
}

Expand All @@ -67,11 +67,11 @@ module.exports = function(client) {
update: function(id, webhook, callback) {
let reqOpts;

if(!id || typeof id !== 'string') {
if (!id || typeof id !== 'string') {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

if(!webhook || typeof webhook !== 'object') {
if (!webhook || typeof webhook !== 'object') {
return Promise.reject(new Error('webhook object is required')).asCallback(callback);
}

Expand Down
6 changes: 3 additions & 3 deletions lib/sparkpost.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults = {
};

resolveUri = function(origin, uri) {
if(!/^http/.test(uri)) {
if (!/^http/.test(uri)) {
uri = url.resolve(origin, uri);
}
return uri;
Expand Down Expand Up @@ -50,7 +50,7 @@ SparkPost = function(apiKey, options) {

this.apiKey = options.key || process.env.SPARKPOST_API_KEY;

if(typeof this.apiKey === 'undefined') {
if (typeof this.apiKey === 'undefined') {
throw new Error('Client requires an API Key.');
}

Expand Down Expand Up @@ -83,7 +83,7 @@ SparkPost.prototype.request = function(options, callback) {
var baseUrl;

// we need options
if(!_.isPlainObject(options)) {
if (!_.isPlainObject(options)) {
throw new TypeError('options argument is required');
}

Expand Down
8 changes: 4 additions & 4 deletions lib/subaccounts.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = function(client) {
get: function(id, callback) {
var options;

if(!id || typeof id !== 'string') {
if (!id || typeof id !== 'string') {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

Expand All @@ -46,7 +46,7 @@ module.exports = function(client) {
create: function(subaccount, callback) {
var reqOpts;

if(!subaccount || typeof subaccount !== 'object') {
if (!subaccount || typeof subaccount !== 'object') {
return Promise.reject(new Error('subaccount object is required')).asCallback(callback);
}

Expand All @@ -67,11 +67,11 @@ module.exports = function(client) {
update: function(id, subaccount, callback) {
var reqOpts;

if(!id || typeof id !== 'string') {
if (!id || typeof id !== 'string') {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

if(!subaccount || typeof subaccount !== 'object') {
if (!subaccount || typeof subaccount !== 'object') {
return Promise.reject(new Error('subaccount object is required')).asCallback(callback);
}

Expand Down
10 changes: 5 additions & 5 deletions lib/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ module.exports = function(client) {
var reqOpts;
options = options || {};

if(!options.id) {
if (!options.id) {
return Promise.reject(new Error('template id is required')).asCallback(callback);
}

reqOpts = {
uri: api + '/' + options.id
};

if(options.draft) {
if (options.draft) {
reqOpts.qs = reqOpts.qs || {};
reqOpts.qs.draft = options.draft;
}
Expand All @@ -50,7 +50,7 @@ module.exports = function(client) {
var object, reqOpts;
options = options || {};

if(!options.template) {
if (!options.template) {
return Promise.reject(new Error('template object is required')).asCallback(callback);
}

Expand All @@ -60,7 +60,7 @@ module.exports = function(client) {
, json: object
};

if(options.update_published) {
if (options.update_published) {
reqOpts.qs = reqOpts.qs || {};
reqOpts.qs.update_published = options.update_published;
}
Expand Down Expand Up @@ -88,7 +88,7 @@ module.exports = function(client) {
var reqOpts;
options = options || {};

if(!options.id) {
if (!options.id) {
return Promise.reject(new Error('template id is required')).asCallback(callback);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/transmissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module.exports = function(client) {
send: function(transmission, callback) {
var reqOpts;

if(!transmission || typeof transmission === 'function') {
if (!transmission || typeof transmission === 'function') {
return Promise.reject(new Error('transmission object is required')).asCallback(callback);
}

Expand All @@ -35,7 +35,7 @@ module.exports = function(client) {
all: function(options, callback) {
var reqOpts;

if(typeof options === 'function') {
if (typeof options === 'function') {
callback = options;
options = {};
}
Expand Down
6 changes: 3 additions & 3 deletions lib/webhooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ module.exports = function(client) {
var reqOpts;
options = options || {};

if(!options.id) {
if (!options.id) {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

if(!options.message) {
if (!options.message) {
return Promise.reject(new Error('message is required')).asCallback(callback);
}

Expand All @@ -114,7 +114,7 @@ module.exports = function(client) {
var reqOpts;
options = options || {};

if(!options.id) {
if (!options.id) {
return Promise.reject(new Error('id is required')).asCallback(callback);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"chai-as-promised": "^5.3.0",
"coveralls": "^2.11.12",
"eslint": "^3.3.1",
"eslint-config-sparkpost": "^1.0.1",
"eslint-config-sparkpost": "^1.2.0",
"istanbul": "^0.4.5",
"mocha": "^3.0.2",
"nock": "^7.2.2",
Expand Down

0 comments on commit 1a20aaa

Please sign in to comment.