expresso-macchiato 0.4.5-dev.2 → 0.4.5-dev.3

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.
package/dist/index.js CHANGED
@@ -666,15 +666,16 @@ var RouterWrapper = class {
666
666
  const handlerRes = await currentMethod.handler(req, res);
667
667
  console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
668
668
  if (handlerRes.contentType) {
669
- console.log(`[${method}] ${this.data.basePath}${path3} CONTENTTYPE`);
670
669
  res.set("Content-Type", handlerRes.contentType);
671
670
  res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
672
- } else if (typeof handlerRes.result === "object") {
673
- console.log(`[${method}] ${this.data.basePath}${path3} OBJECT`);
674
- res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).json(handlerRes.result);
675
- } else {
676
- console.log(`[${method}] ${this.data.basePath}${path3} OTHER`);
677
- res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
671
+ } else if (typeof handlerRes.result === "object") res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).json(handlerRes.result);
672
+ else {
673
+ try {
674
+ console.log("sending status " + handlerRes.status + " result " + handlerRes.result);
675
+ res.status(_nullishCoalesce(handlerRes.status, () => ( 200))).send(handlerRes.result);
676
+ } catch (e) {
677
+ console.log("Not managing numbers???");
678
+ }
678
679
  }
679
680
  } catch (err) {
680
681
  fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${_nullishCoalesce(err.message, () => ( err))}`);
package/dist/index.mjs CHANGED
@@ -666,15 +666,16 @@ var RouterWrapper = class {
666
666
  const handlerRes = await currentMethod.handler(req, res);
667
667
  console.log(`Handling res on [${method}] ${this.data.basePath}${path3}`, JSON.stringify(handlerRes));
668
668
  if (handlerRes.contentType) {
669
- console.log(`[${method}] ${this.data.basePath}${path3} CONTENTTYPE`);
670
669
  res.set("Content-Type", handlerRes.contentType);
671
670
  res.status(handlerRes.status ?? 200).send(handlerRes.result);
672
- } else if (typeof handlerRes.result === "object") {
673
- console.log(`[${method}] ${this.data.basePath}${path3} OBJECT`);
674
- res.status(handlerRes.status ?? 200).json(handlerRes.result);
675
- } else {
676
- console.log(`[${method}] ${this.data.basePath}${path3} OTHER`);
677
- res.status(handlerRes.status ?? 200).send(handlerRes.result);
671
+ } else if (typeof handlerRes.result === "object") res.status(handlerRes.status ?? 200).json(handlerRes.result);
672
+ else {
673
+ try {
674
+ console.log("sending status " + handlerRes.status + " result " + handlerRes.result);
675
+ res.status(handlerRes.status ?? 200).send(handlerRes.result);
676
+ } catch {
677
+ console.log("Not managing numbers???");
678
+ }
678
679
  }
679
680
  } catch (err) {
680
681
  fullLogNok("api", `[${method}] ${this.data.basePath}${path3} => ${err.message ?? err}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expresso-macchiato",
3
- "version": "0.4.5-dev.2",
3
+ "version": "0.4.5-dev.3",
4
4
  "author": "Alessio Velluso",
5
5
  "license": "MIT",
6
6
  "description": "Description",