Skip to content

Commit

Permalink
Fix linting warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
tapio committed Oct 17, 2016
1 parent 830a747 commit 998b660
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,7 @@ LiveServer.start = function(options) {
if (options.noBrowser) openPath = null; // Backwards compatibility with 0.7.0
var file = options.file;
var staticServerHandler = staticServer(root, spa);
var wait = options.wait;
if (wait == null) {
wait = 100;
}
var wait = options.wait === undefined ? 100 : options.wait;
var browser = options.browser || null;
var htpasswd = options.htpasswd || null;
var cors = options.cors || false;
Expand Down Expand Up @@ -297,18 +294,17 @@ LiveServer.start = function(options) {
ws.onopen = function() { ws.send('connected'); };

if (wait > 0) {
(function(ws) {
(function() {
var wssend = ws.send;
var waitTimeout;

ws.send = function() {
var args = arguments;
if (waitTimeout) clearTimeout(waitTimeout);
waitTimeout = setTimeout(function(){
wssend.apply(ws, args);
}, wait);
};
})(ws);
})();
}

ws.onclose = function() {
Expand Down

0 comments on commit 998b660

Please sign in to comment.