Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bluereq

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bluereq - npm Package Compare versions

Comparing version 0.5.0 to 1.0.0

tests/feature/bluereq-head-spec.coffee

28

dist/arg-parser.js
(function() {
var signature;
signature = require("./signature-checker");
signature = require('./signature-checker');

@@ -12,13 +12,13 @@ module.exports = {

switch (method) {
case "GET":
case "DELETE":
case "HEAD":
case 'GET':
case 'DELETE':
case 'HEAD':
opts = this.getOpts(args, false);
break;
case "POST":
case "PUT":
case 'POST':
case 'PUT':
opts = this.getOpts(args, true);
break;
default:
throw new Error("Method must be GET, DELETE, POST, PUT or HEAD");
throw new Error('Method must be GET, DELETE, POST, PUT or HEAD');
}

@@ -34,3 +34,3 @@ opts.config.method = method;

opts = {};
if (signature.matches(args, "object", "function")) {
if (signature.matches(args, 'object', 'function')) {
opts.config = args[0];

@@ -41,3 +41,3 @@ opts.callback = args[1];

}
} else if (signature.matches(args, "string", "function")) {
} else if (signature.matches(args, 'string', 'function')) {
opts.config = {

@@ -52,3 +52,3 @@ url: args[0]

}
} else if (signature.matches(args, "string", "object", "function") && hasData) {
} else if (signature.matches(args, 'string', 'object', 'function') && hasData) {
opts.config = {

@@ -59,3 +59,3 @@ url: args[0],

opts.callback = args[2];
} else if (signature.matches(args, "string")) {
} else if (signature.matches(args, 'string')) {
opts.config = {

@@ -69,3 +69,3 @@ url: args[0]

}
} else if (signature.matches(args, "object")) {
} else if (signature.matches(args, 'object')) {
opts.config = args[0];

@@ -75,3 +75,3 @@ if (opts.config.json === void 0) {

}
} else if (signature.matches(args, "string", "object") && hasData) {
} else if (signature.matches(args, 'string', 'object') && hasData) {
opts.config = {

@@ -82,3 +82,3 @@ url: args[0],

} else {
throw new Error("Invalid params: " + (args.join(', ')));
throw new Error('Invalid params: #{args.join(', ')}');
}

@@ -85,0 +85,0 @@ return opts;

(function() {
var ArgParser, RequestAdapter, request,
var argParser, request, requestAdapter,
__slice = [].slice;
RequestAdapter = require("./request-adapter");
requestAdapter = require('./request-adapter');
ArgParser = require("./arg-parser");
argParser = require('./arg-parser');

@@ -12,4 +12,4 @@ request = function() {

method = arguments[0], args = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
opts = ArgParser.parse(method, args);
return RequestAdapter.makeRequest(opts.config, opts.callback);
opts = argParser.parse(method, args);
return requestAdapter.makeRequest(opts.config, opts.callback);
};

@@ -16,0 +16,0 @@

(function() {
var Promise, request;
request = require("request");
request = require('request');
Promise = require("bluebird");
Promise = require('bluebird');

@@ -11,13 +11,10 @@ Promise.prototype.fail = Promise.prototype.caught;

module.exports = {
makeRequest: function(config, callback) {
makeRequest: function(config) {
return new Promise(function(resolve, reject) {
return request(config, function(err, res) {
if (err != null) {
reject(err);
return reject(err);
} else {
resolve(res);
return resolve(res);
}
if (callback) {
return callback(err, res);
}
});

@@ -24,0 +21,0 @@ });

{
"name": "bluereq",
"version": "0.5.0",
"version": "1.0.0",
"description": "A bluebird promise wrapper for HTTP requests",

@@ -5,0 +5,0 @@ "main": "dist/bluereq.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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