Skip to content

Commit

Permalink
remove dupe code
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonkneen committed Apr 21, 2017
1 parent 97dcced commit e7d726c
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions reste.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]));
}
}

Expand Down Expand Up @@ -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) {

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit e7d726c

Please sign in to comment.