Socket
Socket
Sign inDemoInstall

boom

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.7.0 to 2.7.1

8

lib/index.js

@@ -30,6 +30,7 @@ // Load modules

Hoek.assert(Hoek.isInteger(statusCode) && statusCode >= 400, 'First argument must be a number (400+):', statusCode);
var numberCode = parseInt(statusCode, 10);
Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode);
error.isBoom = true;
error.isServer = statusCode >= 500;
error.isServer = numberCode >= 500;

@@ -41,3 +42,3 @@ if (!error.hasOwnProperty('data')) {

error.output = {
statusCode: statusCode,
statusCode: numberCode,
payload: {},

@@ -295,2 +296,1 @@ headers: {}

};
{
"name": "boom",
"description": "HTTP-friendly error objects",
"version": "2.7.0",
"version": "2.7.1",
"repository": "git://github.com/hapijs/boom",

@@ -6,0 +6,0 @@ "main": "index",

@@ -76,2 +76,18 @@ // Load modules

it('will cast a number-string to an integer', function (done) {
var codes = [
{ input: '404', result: 404 },
{ input: '404.1', result: 404 },
{ input: 400, result: 400 },
{ input: 400.123, result: 400 }]
for (var i = 0, il = codes.length; i < il; ++i) {
var code = codes[i];
var err = Boom.create(code.input);
expect(err.output.statusCode).to.equal(code.result);
}
done();
});
it('throws when statusCode is not finite', function (done) {

@@ -78,0 +94,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc