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

send-data

Package Overview
Dependencies
Maintainers
2
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

send-data - npm Package Compare versions

Comparing version 5.0.0 to 6.0.0

6

error.js

@@ -21,2 +21,3 @@ 'use strict';

verbose: typeof verbose === 'boolean' ? verbose : true,
serializeStack: opts.serializeStack,
bodyStatusCode: opts.bodyStatusCode,

@@ -70,3 +71,2 @@ additionalParams: opts.additionalParams,

if (opts.verbose) {
body.stack = err.stack;
body.expected = err.expected;

@@ -76,2 +76,6 @@ body.debug = err.debug;

if (opts.serializeStack) {
body.stack = err.stack;
}
// Append additional params

@@ -78,0 +82,0 @@ if (opts.additionalParams) {

2

package.json
{
"name": "send-data",
"version": "5.0.0",
"version": "6.0.0",
"description": "send data through response",

@@ -5,0 +5,0 @@ "keywords": [],

@@ -191,3 +191,3 @@ 'use strict';

assert.equal(b.message, 'test');
assert.ok(b.stack);
assert.notok(b.stack);

@@ -198,2 +198,27 @@ assert.end();

test('serializes stack only when told to do so', function t(assert) {
function requestFoo(assertions) {
var s = makeServer({
verbose: true,
serializeStack: true
}, function onReq(req, res, o, cb) {
var err = new Error('test');
err.expected = 'expected';
err.debug = 'debug';
cb(err);
});
hammockRequest(s, {
url: '/foo',
json: true
}, assertions);
}
requestFoo(function onFoo(err, resp) {
var b = resp.body;
assert.ok(b.stack);
assert.end();
});
});
test('send an expected error with verbose', function t(assert) {

@@ -216,3 +241,3 @@ var s = makeServer({

assert.equal(b.message, 'test');
assert.ok(b.stack);
assert.notok(b.stack);

@@ -219,0 +244,0 @@ assert.end();

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