Skip to content

Commit

Permalink
Linted
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Walters committed May 11, 2011
1 parent 060233c commit a84b226
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/auto-uri.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function AutoUri(hostname, opts) {
self.express.post(self.expressPath, self.handleRequest('POST'));
self.express.del(self.expressPath, self.handleRequest('PUT'));
self.express.put(self.expressPath, self.handleRequest('DELETE'));
};
}

module.exports.AutoUri = AutoUri;

Expand Down
6 changes: 3 additions & 3 deletions lib/rest-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ RestClient.prototype.apiCall = function(method, path, options, suc, err, wholePa
} catch(err) {
// Do nothing. Probably wasn't JSON. We'll just return the string.
}
typeof suc == 'function' && suc(body);
if(typeof suc == 'function') suc(body);
});

if(typeof err == 'function') {
Expand Down Expand Up @@ -347,8 +347,8 @@ RestClient.prototype.getRecordingUri = function(sid, encoding, suc, err) {
if(!sid) {
throw new Error('Sid argument required');
}
return 'https://' + API_SERVER + '/' + API_VERSION + '/'
+ self.sid + '/Recordings/' + sid;
return 'https://' + API_SERVER + '/' + API_VERSION + '/' +
self.sid + '/Recordings/' + sid;
};

/**
Expand Down
12 changes: 6 additions & 6 deletions lib/twilio.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function Client(sid, authToken, hostname, opts) {
// Probably a better class structure would eliminate this.
autoUri = new AutoUri(hostname, opts);
RestClient.call(this, sid, authToken);
};
}

util.inherits(Client, RestClient);
module.exports = Client;
Expand Down Expand Up @@ -95,7 +95,7 @@ function PhoneNumber(client, num, opts) {

self.client.updateIncomingNumber(self.attrs.sid, update);
});
};
}

util.inherits(PhoneNumber, EventEmitter);

Expand Down Expand Up @@ -123,7 +123,7 @@ PhoneNumber.prototype.getNumberDetails = function(fn) {
self.attrs.capabilities = numberDetails.capabilities;
self.attrs.sid = numberDetails.sid;

typeof fn == 'function' && fn();
if(typeof fn == 'function') fn();
}

if(self.sid) {
Expand Down Expand Up @@ -166,7 +166,7 @@ PhoneNumber.prototype.setup = function(fn) {
if(!self.attrs.capabilities) {
self.getNumberDetails(fn);
} else {
typeof fn == 'function' && fn();
if(typeof fn == 'function') fn();
}
};

Expand All @@ -178,7 +178,7 @@ function OutgoingCall(from, to, opts, restClient) {
this.opts = opts || {};

EventEmitter.call(this);
};
}

util.inherits(OutgoingCall, EventEmitter);

Expand Down Expand Up @@ -215,7 +215,7 @@ function OutgoingSms(from, to, body, opts, restClient) {
this.opts = opts || {};

EventEmitter.call(this);
};
}

util.inherits(OutgoingSms, EventEmitter);

Expand Down
16 changes: 8 additions & 8 deletions lib/twiml.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function Verb(body, attrs) {

depth = depth || 0;

for(var i = 0; i < depth; i++) {
for(var j = 0; j < depth; j++) {
stringified += '\t';
}

Expand All @@ -71,12 +71,12 @@ function Verb(body, attrs) {

stringified += this.body;
} else {
for(var i = 0; i < this.body.length; i++) {
stringified += this.body[i].toString(depth + 1);
for(var k = 0; k < this.body.length; k++) {
stringified += this.body[k].toString(depth + 1);
}
}
stringified += '\n';
for(var i = 0; i < depth; i++) {
for(var l = 0; l < depth; l++) {
stringified += '\t';
}
stringified += '</' + this.type + '>';
Expand Down Expand Up @@ -224,7 +224,7 @@ util.inherits(Gather, EventEmitter);
* });
*/
var Record = module.exports.Record = function Record(attrs) {
var self = this;
var self = this, uri;

this.type = 'Record';
this.nestable = {};
Expand All @@ -233,16 +233,16 @@ var Record = module.exports.Record = function Record(attrs) {

Verb.call(this, null, attrs);
EventEmitter.call(this);

if(!attrs.action && global.autoUri) {
var uri = global.autoUri.addCallback('POST', function(req, res) {
uri = global.autoUri.addCallback('POST', function(req, res) {
self.emit('recorded', req.body, new Response(res));
}, {maxRequests: 1});
this.attrs.action = uri;
this.attrs.method = 'POST';
}
if (attrs.transcribe && global.autoUri) {
var uri = global.autoUri.addCallback('POST', function(req, res) {
uri = global.autoUri.addCallback('POST', function(req, res) {
self.emit('transcribed', req.body, new Response(res));
}, {maxRequests: 1});
this.attrs.transcribeCallback = uri;
Expand Down

0 comments on commit a84b226

Please sign in to comment.