New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

sparc-commons

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sparc-commons - npm Package Compare versions

Comparing version 0.2.28 to 0.3.0

7

libs/resources.js

@@ -34,6 +34,7 @@ /*jshint multistr: true */

* @param {Object} opts
* @param {String} [opts.rest] the dynamic path added to the URL
* @param {Object} [opts.request] the request options
* @param {Stream} [opts.stream] if this is true, then data is ignored
* @param {Object} [opts.data] key value pairs to be set in the request
* @param {Object} [opts.header] optional header in case of post requests
* @param {Object} [opts.headers] optional header in case of post requests
* @return {Stream<JSON>}

@@ -75,2 +76,6 @@ */

if(opts.rest){
url += '/' + opts.rest
}
if (requestStream) {

@@ -77,0 +82,0 @@ // in this case all data options are brutally added to the url.

2

package.json
{
"name": "sparc-commons",
"version": "0.2.28",
"version": "0.3.0",
"description": "Library with all small time common stuff used across the SPARC echosystem",

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

@@ -19,2 +19,14 @@ var nock = require('nock');

it("Tests rest", function(){
nock("http://bogus.com")
.get("/bellobell/pippo,pappo")
.query({apikey: "asdfg", friggitoria: 'cadetta'})
.reply(200, 'Hallo');
return requestResource("test_resource", "boguservice", { rest: 'pippo,pappo', query: { friggitoria: 'cadetta' }})
.then(function(result){
assert(result, 'Hallo')
})
})
it("Tests resource returning an error", function(){

@@ -21,0 +33,0 @@ nock("http://bogus.com")

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