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

create-boom-error

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-boom-error - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

CHANGELOG.md

17

index.js
'use strict';
var Boom = require('boom');
const Boom = require('@hapi/boom');
/**
*
* @param {string} name
* @param {number} statusCode
* @param {function | string} message
* @returns {new () => Boom<null>}
*/
function createBoomError(name, statusCode, message) {

@@ -11,2 +18,3 @@ var exports = this;

this.message = undefined;
if (typeof message === 'string') {

@@ -18,3 +26,7 @@ this.message = message;

Boom.wrap(this, statusCode);
Boom.boomify(this, { statusCode, });
if (message === undefined) {
Reflect.deleteProperty(this.output.payload, 'message');
}
}

@@ -31,5 +43,4 @@

return ErrorCtor;
}
module.exports = createBoomError;

6

package.json
{
"name": "create-boom-error",
"version": "0.1.0",
"version": "0.2.0",
"description": "Simply create sub-classed Boom errors for Hapi applications.",

@@ -29,7 +29,7 @@ "main": "index.js",

"chai": "^2.1.2",
"mocha": "^2.2.1"
"mocha": "^7.1.0"
},
"dependencies": {
"boom": "^2.6.1"
"@hapi/boom": "^7.4.0"
}
}

@@ -1,4 +0,3 @@

# create-boom-error
[![npm version](https://badge.fury.io/js/create-boom-error.svg)](http://badge.fury.io/js/create-boom-error)
[![Build Status](https://travis-ci.org/lob/create-boom-error.svg)](https://travis-ci.org/lob/create-boom-error)
# create-boom-error [![npm version](https://badge.fury.io/js/create-boom-error.svg)](http://badge.fury.io/js/create-boom-error) [![Build Status](https://travis-ci.org/lob/create-boom-error.svg)](https://travis-ci.org/lob/create-boom-error)
A simple Node.js library for easily creating classed Boom errors in Hapi applications.

@@ -8,3 +7,3 @@

`npm install create-boom-error`
`yarn add create-boom-error`

@@ -68,5 +67,6 @@ # Usage

# TODO
# Development
- [ ] Add to Travis
- [ ] Push to NPM
## Run tests
`yarn test`

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