Update type of header object values

This commit is contained in:
Alexander James Phillips
2017-04-04 14:17:17 +01:00
parent d245364d9b
commit 74939cd275
2 changed files with 5 additions and 6 deletions
+3 -1
View File
@@ -1,7 +1,9 @@
import Boom = require('boom');
Boom.wrap(new Error('test'), 400, 'some message');
var bo = Boom.wrap(new Error('test'), 400, 'some message');
var a: string = bo.output.headers['some header'];
Boom.create(500, 'Internal server error', { timestamp: Date.now() });
Boom.badRequest('message', {some: 'data'});
+2 -5
View File
@@ -29,11 +29,8 @@ declare namespace Boom {
export interface Output {
/** statusCode - the HTTP status code (typically 4xx or 5xx). */
statusCode: number;
/**
* headers - an object containing any HTTP headers where each key is a header name and value is the header content.
* TODO can we limit value type any to string?
*/
headers: {[index: string]: any};
/** headers - an object containing any HTTP headers where each key is a header name and value is the header content. (Limited value type to string https://github.com/hapijs/boom/issues/151 ) */
headers: {[index: string]: string};
/** payload - the formatted object used as the response payload (stringified). Can be directly manipulated but any changes will be lost if reformat() is called. Any content allowed and by default includes the following content: */
payload: {
/** statusCode - the HTTP status code, derived from error.output.statusCode. */