@taladel/common 1.0.11 → 1.0.13

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.
@@ -1,4 +1,4 @@
1
1
  import { Request, Response, NextFunction } from "express";
2
2
  declare const errorHandler: (err: Error, _req: Request, res: Response, _next: NextFunction) => void;
3
- export default errorHandler;
3
+ export { errorHandler };
4
4
  //# sourceMappingURL=error-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGxD,QAAA,MAAM,YAAY,GACf,KAAK,KAAK,EACV,MAAM,OAAO,EACb,KAAK,QAAQ,EACb,OAAO,YAAY,KACpB,IAQF,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGzD,QAAA,MAAM,YAAY,GACd,KAAK,KAAK,EACV,MAAM,OAAO,EACb,KAAK,QAAQ,EACb,OAAO,YAAY,KACpB,IAQF,CAAC;AACF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.errorHandler = void 0;
3
4
  const custom_error_1 = require("../errors/custom-error");
4
5
  const errorHandler = (err, _req, res, _next) => {
5
6
  if (err instanceof custom_error_1.CustomError) {
@@ -8,5 +9,5 @@ const errorHandler = (err, _req, res, _next) => {
8
9
  console.error(err.stack);
9
10
  res.status(500).json({ message: err.message || 'Internal Server Error' });
10
11
  };
11
- exports.default = errorHandler;
12
+ exports.errorHandler = errorHandler;
12
13
  //# sourceMappingURL=error-handler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":";;AACA,yDAAqD;AAEpD,MAAM,YAAY,GAAG,CAClB,GAAU,EACV,IAAa,EACb,GAAa,EACb,KAAmB,EACf,EAAE;IAEN,IAAG,GAAG,YAAY,0BAAW,EAAC,CAAC;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AAEF,kBAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middlewares/error-handler.ts"],"names":[],"mappings":";;;AACA,yDAAqD;AAErD,MAAM,YAAY,GAAG,CACjB,GAAU,EACV,IAAa,EACb,GAAa,EACb,KAAmB,EACf,EAAE;IAEN,IAAG,GAAG,YAAY,0BAAW,EAAC,CAAC;QAC3B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACzB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,IAAI,uBAAuB,EAAE,CAAC,CAAC;AAC9E,CAAC,CAAC;AACO,oCAAY"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taladel/common",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "common utilities for microservices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import {Request, Response, NextFunction } from "express";
2
2
  import { CustomError } from "../errors/custom-error";
3
3
 
4
- const errorHandler = (
4
+ const errorHandler = (
5
5
  err: Error,
6
6
  _req: Request,
7
7
  res: Response,
@@ -15,5 +15,4 @@ import { CustomError } from "../errors/custom-error";
15
15
  console.error(err.stack);
16
16
  res.status(500).json({ message: err.message || 'Internal Server Error' });
17
17
  };
18
-
19
- export default errorHandler;
18
+ export { errorHandler };