Skip to content

Commit 60893c0

Browse files
committed
Remove typeof property
1 parent 70c0964 commit 60893c0

File tree

2 files changed

+0
-51
lines changed

2 files changed

+0
-51
lines changed

lib/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@ exports.Boom = class Boom extends Error {
8484
Error.captureStackTrace(this, ctor); // Filter the stack to our external API
8585

8686
this.#apply(data, statusCode, headers);
87-
88-
Object.defineProperty(this, 'typeof', { value: ctor });
8987
}
9088

9189
static [Symbol.hasInstance](instance) {

test/index.js

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -972,55 +972,6 @@ describe('Boom', () => {
972972
});
973973
});
974974

975-
describe('error.typeof', () => {
976-
977-
const types = [
978-
'badRequest',
979-
'unauthorized',
980-
'forbidden',
981-
'notFound',
982-
'methodNotAllowed',
983-
'notAcceptable',
984-
'proxyAuthRequired',
985-
'clientTimeout',
986-
'conflict',
987-
'resourceGone',
988-
'lengthRequired',
989-
'preconditionFailed',
990-
'entityTooLarge',
991-
'uriTooLong',
992-
'unsupportedMediaType',
993-
'rangeNotSatisfiable',
994-
'expectationFailed',
995-
'badData',
996-
'preconditionRequired',
997-
'tooManyRequests',
998-
'internal',
999-
'notImplemented',
1000-
'badGateway',
1001-
'serverUnavailable',
1002-
'gatewayTimeout',
1003-
'badImplementation'
1004-
];
1005-
1006-
types.forEach((name) => {
1007-
1008-
it(`matches typeof Boom.${name}`, () => {
1009-
1010-
const error = Boom[name]();
1011-
types.forEach((type) => {
1012-
1013-
if (type === name) {
1014-
expect(error.typeof).to.shallow.equal(Boom[name]);
1015-
}
1016-
else {
1017-
expect(error.typeof).to.not.shallow.equal(Boom[type]);
1018-
}
1019-
});
1020-
});
1021-
});
1022-
});
1023-
1024975
describe('reformat()', () => {
1025976

1026977
it('displays internal server error messages in debug mode', () => {

0 commit comments

Comments
 (0)