@hapi/boom
Advanced tools
Comparing version 8.0.1 to 9.0.0
@@ -433,3 +433,13 @@ /** | ||
/** | ||
* Returns a 425 Too Early error | ||
* | ||
* @param message - Optional message | ||
* @param data - Optional additional error data | ||
* | ||
* @returns A 425 Too Early error | ||
*/ | ||
export function tooEarly<Data>(message?: string, data?: Data): Boom<Data>; | ||
/** | ||
@@ -436,0 +446,0 @@ * Returns a 428 Precondition Required error |
@@ -48,3 +48,3 @@ 'use strict'; | ||
[424, 'Failed Dependency'], | ||
[425, 'Unordered Collection'], | ||
[425, 'Too Early'], | ||
[426, 'Upgrade Required'], | ||
@@ -161,3 +161,3 @@ [428, 'Precondition Required'], | ||
let wwwAuthenticate = `${scheme} `; | ||
let wwwAuthenticate = `${scheme}`; | ||
@@ -172,7 +172,7 @@ if (attributes || | ||
if (typeof attributes === 'string') { | ||
wwwAuthenticate += Hoek.escapeHeaderAttribute(attributes); | ||
wwwAuthenticate += ' ' + Hoek.escapeHeaderAttribute(attributes); | ||
err.output.payload.attributes = attributes; | ||
} | ||
else { | ||
wwwAuthenticate += Object.keys(attributes).map((name) => { | ||
wwwAuthenticate += ' ' + Object.keys(attributes).map((name) => { | ||
@@ -195,6 +195,6 @@ let value = attributes[name]; | ||
if (attributes) { | ||
wwwAuthenticate += ', '; | ||
wwwAuthenticate += ','; | ||
} | ||
wwwAuthenticate += `error="${Hoek.escapeHeaderAttribute(message)}"`; | ||
wwwAuthenticate += ` error="${Hoek.escapeHeaderAttribute(message)}"`; | ||
err.output.payload.attributes.error = message; | ||
@@ -340,3 +340,8 @@ } | ||
exports.tooEarly = function (message, data) { | ||
return new exports.Boom(message, { statusCode: 425, data, ctor: exports.tooEarly }); | ||
}; | ||
exports.preconditionRequired = function (message, data) { | ||
@@ -343,0 +348,0 @@ |
@@ -1,2 +0,2 @@ | ||
Copyright (c) 2012-2019, Sideway Inc, and project contributors | ||
Copyright (c) 2012-2020, Sideway Inc, and project contributors | ||
Copyright (c) 2012-2014, Walmart. | ||
@@ -3,0 +3,0 @@ All rights reserved. |
{ | ||
"name": "@hapi/boom", | ||
"description": "HTTP-friendly error objects", | ||
"version": "8.0.1", | ||
"version": "9.0.0", | ||
"repository": "git://github.com/hapijs/boom", | ||
@@ -16,7 +16,7 @@ "main": "lib/index.js", | ||
"dependencies": { | ||
"@hapi/hoek": "8.x.x" | ||
"@hapi/hoek": "9.x.x" | ||
}, | ||
"devDependencies": { | ||
"@hapi/code": "6.x.x", | ||
"@hapi/lab": "20.x.x" | ||
"@hapi/code": "8.x.x", | ||
"@hapi/lab": "22.x.x" | ||
}, | ||
@@ -23,0 +23,0 @@ "scripts": { |
@@ -15,3 +15,4 @@ <a href="https://hapi.dev"><img src="https://raw.githubusercontent.com/hapijs/assets/master/images/family.png" width="180px" align="right" /></a> | ||
- [Version status](https://hapi.dev/resources/status/#boom) (builds, dependencies, node versions, licenses, eol) | ||
- [Changelog](https://hapi.dev/family/boom/changelog/) | ||
- [Project policies](https://hapi.dev/policies/) | ||
- [Free and commercial support options](https://hapi.dev/support/) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
27778
741
18
0
5
+ Added@hapi/hoek@9.3.0(transitive)
- Removed@hapi/hoek@8.5.1(transitive)
Updated@hapi/hoek@9.x.x