Socket
Socket
Sign inDemoInstall

superagent-defaults

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

superagent-defaults - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

2

component.json

@@ -5,3 +5,3 @@ {

"description": "Create some defaults for superagent requests",
"version": "0.1.13",
"version": "0.1.14",
"keywords": [],

@@ -8,0 +8,0 @@ "dependencies": {

@@ -26,4 +26,4 @@ /**

}
var proto = Context.prototype = {};
// setup methods for context

@@ -35,3 +35,3 @@

Context.prototype[method] = function() {
proto[method] = function() {
this.stack.push({

@@ -52,3 +52,3 @@ method: method,

Context.prototype.applyStack = function(req) {
proto.applyStack = function(req) {
this.stack.forEach(function(operation) {

@@ -62,14 +62,10 @@ req[operation.method].apply(req, operation.args);

each(methods, function(method) {
var name = 'delete' == method ? 'del' : method;
var targetMethod = method == 'delete' ? 'del' : method;
var httpMethod = method.toUpperCase();
proto[method] = function(url, fn) {
var r = this.request;
var req = r instanceof Function ?
r(httpMethod, url) :
r[targetMethod](url);
method = method.toUpperCase();
Context.prototype[name] = function(url, fn) {
var req;
if (this.request instanceof Function) {
req = this.request(method, url);
} else {
req = this.request[method.toLowerCase()](url);
}
// Do the attaching here

@@ -86,2 +82,4 @@ this.applyStack(req);

proto.del = proto['delete'];
/**

@@ -88,0 +86,0 @@ * Iterate array-ish.

{
"name": "superagent-defaults",
"version": "0.1.13",
"version": "0.1.14",
"description": "Create some defaults for superagent requests",

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

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