Comparing version 0.5.9 to 0.5.10
{ | ||
"name": "popsicle", | ||
"version": "0.5.9", | ||
"version": "0.5.10", | ||
"description": "Simple HTTP requests for node and the browser", | ||
@@ -8,2 +8,3 @@ "main": "popsicle.js", | ||
"popsicle.js", | ||
"popsicle.d.ts", | ||
"LICENSE", | ||
@@ -81,3 +82,6 @@ "logo.svg" | ||
"tough-cookie": "^0.12.1" | ||
}, | ||
"typescript": { | ||
"definition": "popsicle.d.ts" | ||
} | ||
} |
@@ -58,23 +58,2 @@ /* global define */ | ||
/** | ||
* Grab properties from an object to create a new object. | ||
* | ||
* @param {Object} obj | ||
* @param {Array} props | ||
* @return {Object} | ||
*/ | ||
function pluck (obj, props) { | ||
var dest = {} | ||
for (var i = 0; i < props.length; i++) { | ||
var prop = props[i] | ||
if (obj[prop] != null) { | ||
dest[prop] = obj[prop] | ||
} | ||
} | ||
return dest | ||
} | ||
/** | ||
* Create a function to set progress properties on a request instance. | ||
@@ -943,8 +922,7 @@ * | ||
Response.prototype.toJSON = function () { | ||
return pluck(this, [ | ||
'headers', | ||
'headerNames', | ||
'status', | ||
'body' | ||
]) | ||
return { | ||
headers: this.get(), | ||
body: this.body, | ||
status: this.status | ||
} | ||
} | ||
@@ -1057,26 +1035,7 @@ | ||
Request.prototype.toJSON = function () { | ||
return pluck(this, [ | ||
'url', | ||
'method', | ||
'query', | ||
'timeout', | ||
'maxRedirects', | ||
'rejectUnauthorized', | ||
'stream', | ||
'raw', | ||
'encoding', | ||
'parse', | ||
'withCredentials', | ||
'uploaded', | ||
'downloaded', | ||
'completed', | ||
'uploadSize', | ||
'uploadTotal', | ||
'downloadSize', | ||
'downloadTotal', | ||
'headers', | ||
'headerNames', | ||
'opened', | ||
'aborted' | ||
]) | ||
return { | ||
url: this.fullUrl(), | ||
method: this.method, | ||
headers: this.get() | ||
} | ||
} | ||
@@ -1083,0 +1042,0 @@ |
@@ -276,2 +276,6 @@ # ![Popsicle](https://cdn.rawgit.com/blakeembrey/popsicle/master/logo.svg) | ||
## TypeScript | ||
The `popsicle.d.ts` file is being maintained in the current repository. | ||
## Development and Testing | ||
@@ -278,0 +282,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
57833
6
1500
304