Comparing version
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var api, slumber; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var api, slumber; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var api, slumber; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -76,3 +76,3 @@ var API, Serializer, append_slash, callable, debug, hasInsensitive, merge, querystring, ref, request, | ||
_Class.prototype._try_to_serialize = function(response, body) { | ||
var content_type, e, stype; | ||
var content_type, e, error, stype; | ||
if (response.headers['content-type'] != null) { | ||
@@ -82,4 +82,4 @@ content_type = response.headers['content-type'].split(';')[0].replace(/^\s*|\s*$/g, ''); | ||
stype = this.serializer.get_serializer(null, content_type); | ||
} catch (_error) { | ||
e = _error; | ||
} catch (error) { | ||
e = error; | ||
return body; | ||
@@ -93,3 +93,3 @@ } | ||
_Class.prototype._construct_request = function(method, kwargs) { | ||
var base, defaultVersion, key, ref1, request_options, value; | ||
var base, defaultVersion, key, prop, ref1, ref2, request_options, value; | ||
request_options = { | ||
@@ -124,3 +124,7 @@ url: this.base_url, | ||
if (kwargs.data != null) { | ||
request_options.form = kwargs.data; | ||
prop = 'json'; | ||
if (((ref2 = kwargs.headers) != null ? ref2['content-type'] : void 0) === 'application/x-www-form-urlencoded') { | ||
prop = 'form'; | ||
} | ||
request_options[prop] = kwargs.data; | ||
} | ||
@@ -127,0 +131,0 @@ if (this.opts.auth) { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var API; |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -58,3 +58,6 @@ var BaseSerializer, JsonSerializer, SERIALIZERS, YamlSerializer, debug, yamljs, | ||
JsonSerializer.prototype.loads = function(data) { | ||
return JSON.parse(data); | ||
if (typeof data === 'string') { | ||
return JSON.parse(data); | ||
} | ||
return data; | ||
}; | ||
@@ -99,3 +102,3 @@ | ||
SERIALIZERS.yaml = YamlSerializer; | ||
} catch (_error) {} | ||
} catch (undefined) {} | ||
@@ -102,0 +105,0 @@ module.exports.Serializer = (function() { |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var debug, extend, |
{ | ||
"name": "slumber", | ||
"version": "0.8.0", | ||
"version": "0.9.0", | ||
"description": "Port of Python's slumber library -- A library that makes consuming a RESTful API easier and more convenient", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,2 +0,2 @@ | ||
// Generated by CoffeeScript 1.9.3 | ||
// Generated by CoffeeScript 1.10.0 | ||
(function() { | ||
@@ -3,0 +3,0 @@ var CUSTOMERS, app, assert, base_url, connect, express, freeport, querystring, slumber, url; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
71309
0.63%1134
0.62%