Skip to content

Commit

Permalink
code modification to conform to style guide.
Browse files Browse the repository at this point in the history
  • Loading branch information
zweihan committed Feb 13, 2016
1 parent 1657971 commit 05250b0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
5 changes: 3 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ function lookup(uri, opts) {
}
io = cache[id];
}
if(parsed.query && !opts.query){
if (parsed.query && !opts.query) {
opts.query = parsed.query;
}else if(opts && 'object' == typeof opts.query){
} else if (opts && 'object' == typeof opts.query) {

function encodeQueryString(obj){
var str = [];
for(var p in obj)
Expand Down
4 changes: 1 addition & 3 deletions lib/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,8 @@ Manager.prototype.destroy = function(socket){
Manager.prototype.packet = function(packet){
debug('writing packet %j', packet);
var self = this;
if(packet.query && packet.type == 0){
if (packet.query && packet.type == 0) packet.nsp += '?' + packet.query;

packet.nsp += '?' + packet.query;
}
if (!self.encoding) {
// encode, then write to engine with result
self.encoding = true;
Expand Down
4 changes: 2 additions & 2 deletions lib/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ Socket.prototype.onopen = function(){
debug('transport is open - connecting');
// write connect packet if necessary
if ('/' != this.nsp) {
if(this.query){
if (this.query) {
this.packet({ type: parser.CONNECT, query: this.query});
}else {
} else {
this.packet({type: parser.CONNECT});
}
}
Expand Down

0 comments on commit 05250b0

Please sign in to comment.