Socket
Socket
Sign inDemoInstall

popsicle

Package Overview
Dependencies
Maintainers
1
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

popsicle - npm Package Compare versions

Comparing version 0.5.9 to 0.5.10

popsicle.d.ts

6

package.json
{
"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"
}
}

61

popsicle.js

@@ -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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc