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

hammock

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hammock - npm Package Compare versions

Comparing version 0.1.10 to 1.0.0

22

lib/request.js

@@ -5,3 +5,3 @@ var Cookies = require('cookies');

var util = require('util');
var EventEmitter = require('events').EventEmitter;
var PassThrough = require('readable-stream').PassThrough;
var _ = require('lodash');

@@ -18,3 +18,3 @@

EventEmitter.call(this, options);
PassThrough.call(this, options);

@@ -50,3 +50,3 @@ this.body = '';

util.inherits(MockRequest, EventEmitter);
util.inherits(MockRequest, PassThrough);

@@ -74,18 +74,2 @@

MockRequest.prototype.pause = function() {};
MockRequest.prototype.resume = function() {};
MockRequest.prototype.write = function(str) {
this.body += str;
};
MockRequest.prototype.end = function(str) {
if (str) {
this.write(str);
}
this.emit('data', new Buffer(this.body));
this.emit('end');
};
module.exports = MockRequest;

2

lib/response.js

@@ -16,3 +16,3 @@ var events = require('events');

this.buffer = [];
this.statusCode = null;
this.statusCode = 200;
this._headers = {};

@@ -19,0 +19,0 @@ this.on('data', function(chunk) {

{
"name": "hammock",
"version": "0.1.10",
"version": "1.0.0",
"description": "Node.js mock / polyfill http object library for http req / res",

@@ -23,3 +23,4 @@ "main": "index.js",

"cookies": "~0.3.6",
"lodash": "~2.4.1"
"lodash": "~2.4.1",
"readable-stream": "~1.0.33"
},

@@ -26,0 +27,0 @@ "devDependencies": {

@@ -29,9 +29,13 @@ var test = require('tape');

var _body = ''
req.on('data', function(body) {
t.equals(body.toString(), 'foobar', 'Body should have been pushed from mock req.');
_body += body
})
req.once('end', function () {
t.equals(_body.toString(), 'foobar', 'Body should have been pushed from mock req.');
t.end();
});
})
req.write('foo');
req.end('bar');
});
});
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