Skip to content
Permalink
Browse files

Enhance 'boolean' comparison

  • Loading branch information
jmillan committed Dec 9, 2012
1 parent 24fcdbb commit 9fccaf5e406723a944514ee187c0ca5da00b1eeb
Showing with 5 additions and 26 deletions.
  1. +5 −26 src/UA.js
@@ -886,12 +886,7 @@ JsSIP.UA.configuration_check = {
}
},
register: function(register) {
if(typeof register !== 'boolean') {
console.log(JsSIP.c.LOG_UA +'register must be true or false');
return false;
} else {
return true;
}
return typeof register === 'boolean';
},
display_name: function(display_name) {
if(JsSIP.grammar.parse('"' + display_name + '"', 'display_name') === -1) {
@@ -908,11 +903,7 @@ JsSIP.UA.configuration_check = {
}
},
trace_sip: function(trace_sip) {
if(typeof trace_sip !== 'boolean') {
return false;
} else {
return true;
}
return typeof trace_sip === 'boolean';
},
password: function(password) {
if(JsSIP.grammar.parse(password, 'password') === -1) {
@@ -961,25 +952,13 @@ JsSIP.UA.configuration_check = {
}
},
use_preloaded_route: function(use_preloaded_route) {
if(typeof use_preloaded_route !== 'boolean') {
return false;
} else {
return true;
}
return typeof use_preloaded_route === 'boolean';
},
hack_via_tcp: function(hack_via_tcp) {
if(typeof hack_via_tcp !== 'boolean') {
return false;
} else {
return true;
}
return typeof hack_via_tcp === 'boolean';
},
hack_ip_in_contact: function(hack_ip_in_contact) {
if(typeof hack_ip_in_contact !== 'boolean') {
return false;
} else {
return true;
}
return typeof hack_ip_in_contact === 'boolean';
}
}
};

0 comments on commit 9fccaf5

Please sign in to comment.
You can’t perform that action at this time.