@jpbs/common 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,6 @@ class BadRequestError extends custom_error_1.CustomError {
8
8
  super(message);
9
9
  this.message = message;
10
10
  this.statusCode = http_status_codes_1.StatusCodes.BAD_REQUEST;
11
- Object.setPrototypeOf(this, BadRequestError.prototype);
12
11
  }
13
12
  serializeErrors() {
14
13
  return [{ message: this.message }];
@@ -4,7 +4,7 @@ exports.CustomError = void 0;
4
4
  class CustomError extends Error {
5
5
  constructor(message) {
6
6
  super(message);
7
- Object.setPrototypeOf(this, CustomError.prototype);
7
+ Object.setPrototypeOf(this, new.target.prototype);
8
8
  }
9
9
  }
10
10
  exports.CustomError = CustomError;
@@ -7,7 +7,6 @@ class EmailError extends custom_error_1.CustomError {
7
7
  constructor(message) {
8
8
  super(message);
9
9
  this.statusCode = http_status_codes_1.StatusCodes.INTERNAL_SERVER_ERROR;
10
- Object.setPrototypeOf(this, EmailError.prototype);
11
10
  }
12
11
  serializeErrors() {
13
12
  return [{ message: this.message }];
@@ -8,7 +8,6 @@ class NotAuthorizedError extends custom_error_1.CustomError {
8
8
  super(message);
9
9
  this.message = message;
10
10
  this.statusCode = http_status_codes_1.StatusCodes.UNAUTHORIZED;
11
- Object.setPrototypeOf(this, NotAuthorizedError.prototype);
12
11
  }
13
12
  serializeErrors() {
14
13
  return [{ message: this.message }];
@@ -8,7 +8,6 @@ class NotFoundError extends custom_error_1.CustomError {
8
8
  super(message);
9
9
  this.message = message;
10
10
  this.statusCode = http_status_codes_1.StatusCodes.NOT_FOUND;
11
- Object.setPrototypeOf(this, NotFoundError.prototype);
12
11
  }
13
12
  serializeErrors() {
14
13
  return [{ message: this.message }];
@@ -8,7 +8,6 @@ class RequestValidationError extends custom_error_1.CustomError {
8
8
  super('Invalid request parameters');
9
9
  this.errors = errors;
10
10
  this.statusCode = http_status_codes_1.StatusCodes.BAD_REQUEST;
11
- Object.setPrototypeOf(this, RequestValidationError.prototype);
12
11
  }
13
12
  serializeErrors() {
14
13
  return this.errors.map(err => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jpbs/common",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [