From e7d726c348225adc639d77061b17200b61366c98 Mon Sep 17 00:00:00 2001 From: jasonkneen Date: Fri, 21 Apr 2017 16:39:27 +0100 Subject: [PATCH] remove dupe code --- reste.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/reste.js b/reste.js index d4b1ef9..e79885c 100644 --- a/reste.js +++ b/reste.js @@ -116,9 +116,7 @@ var main = function() { http.setRequestHeader(header.name, typeof header.value == "function" ? header.value() : header.value); - if (config.debug) { - log("Setting global header - " + header.name + ": " + (typeof header.value == "function" ? header.value() : header.value)); - } + log("Setting global header - " + header.name + ": " + (typeof header.value == "function" ? header.value() : header.value)); }); // non-global headers @@ -133,9 +131,7 @@ var main = function() { http.setRequestHeader(header, typeof args.headers[header] == "function" ? args.headers[header]() : args.headers[header]); - if (config.debug) { - log("Setting local header - " + header + ": " + (typeof args.headers[header] == "function" ? args.headers[header]() : args.headers[header])); - } + log("Setting local header - " + header + ": " + (typeof args.headers[header] == "function" ? args.headers[header]() : args.headers[header])); } } @@ -264,9 +260,8 @@ var main = function() { // add a new method reste.addMethod = function(args) { - if (config.debug) { - log(args.requestHeaders); - } + + log(args.requestHeaders); reste[args.name] = function(params, onLoad, onError) { @@ -458,10 +453,7 @@ var main = function() { // Intercept sync to handle collections / models Backbone.sync = function(method, model, options) { - if (config.debug) { - log("Backbone.sync: " + method + model._type); - } - + log("Backbone.sync: " + method + model._type); var modelConfig = reste.modelConfig[model._type]; var body;