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

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

boom - npm Package Compare versions

Comparing version 3.1.3 to 3.2.0

6

lib/index.js

@@ -319,2 +319,8 @@ 'use strict';

exports.locked = function (message, data) {
return internals.create(423, message, data, exports.locked);
};
exports.preconditionRequired = function (message, data) {

@@ -321,0 +327,0 @@

2

package.json
{
"name": "boom",
"description": "HTTP-friendly error objects",
"version": "3.1.3",
"version": "3.2.0",
"repository": "git://github.com/hapijs/boom",

@@ -6,0 +6,0 @@ "main": "lib/index.js",

@@ -35,2 +35,3 @@ ![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png)

- [`Boom.badData([message], [data])`](#boombaddatamessage-data)
- [`Boom.locked([message], [data])`](#boomlockedmessage-data)
- [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data)

@@ -512,2 +513,22 @@ - [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data)

### `Boom.locked([message], [data])`
Returns a 423 Locked error where:
- `message` - optional message.
- `data` - optional additional error data.
```js
Boom.locked('this resource has been locked');
```
Generates the following response payload:
```json
{
"statusCode": 423,
"error": "Locked",
"message": "this resource has been locked"
}
```
### `Boom.preconditionRequired([message], [data])`

@@ -514,0 +535,0 @@

@@ -466,2 +466,18 @@ 'use strict';

describe('locked()', () => {
it('returns a 423 error statusCode', (done) => {
expect(Boom.locked().output.statusCode).to.equal(423);
done();
});
it('sets the message with the passed in message', (done) => {
expect(Boom.locked('my message').message).to.equal('my message');
done();
});
});
describe('preconditionRequired()', () => {

@@ -468,0 +484,0 @@

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