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.8 to 0.5.9

2

package.json
{
"name": "popsicle",
"version": "0.5.8",
"version": "0.5.9",
"description": "Simple HTTP requests for node and the browser",

@@ -5,0 +5,0 @@ "main": "popsicle.js",

@@ -58,2 +58,23 @@ /* 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.

@@ -917,2 +938,16 @@ *

/**
* Return a JSON stringify-able object.
*
* @return {Object}
*/
Response.prototype.toJSON = function () {
return pluck(this, [
'headers',
'headerNames',
'status',
'body'
])
}
/**
* Initialise a request instance.

@@ -1017,2 +1052,34 @@ *

/**
* Return a JSON stringify-able object.
*
* @return {Object}
*/
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'
])
}
/**
* Retrieve the current request URL.

@@ -1019,0 +1086,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