@ololoepepe/controllers 0.2.24 → 0.2.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ololoepepe/controllers",
3
- "version": "0.2.24",
3
+ "version": "0.2.28",
4
4
  "description": "Common Express controllers library",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,12 +21,12 @@
21
21
  },
22
22
  "homepage": "https://gitlab.void-walkers.com/libs/node.js/controllers#README",
23
23
  "devDependencies": {
24
- "body-parser": "^1.19.0",
24
+ "body-parser": "^1.19.1",
25
25
  "chai": "^4.3.4",
26
26
  "chai-http": "^4.3.0",
27
- "eslint": "^8.1.0",
27
+ "eslint": "^8.7.0",
28
28
  "eslint-config-xo": "^0.39.0",
29
- "express": "^4.17.1",
30
- "mocha": "^9.1.3"
29
+ "express": "^4.17.2",
30
+ "mocha": "^9.2.0"
31
31
  }
32
32
  }
@@ -22,7 +22,7 @@ const {selectStatusCode} = require('../lib/helper');
22
22
  function jsonController(callback, statusCode) {
23
23
  return async (req, res, next) => {
24
24
  try {
25
- const result = await callback(req);
25
+ const result = await callback(req, res);
26
26
 
27
27
  const json = (result === undefined) ? {} : result;
28
28
 
@@ -16,7 +16,7 @@
16
16
  function noContentController(callback, statusCode = 204) {
17
17
  return async (req, res, next) => {
18
18
  try {
19
- await callback(req);
19
+ await callback(req, res);
20
20
 
21
21
  res.sendStatus(statusCode);
22
22
  } catch (err) {
@@ -22,7 +22,7 @@ const {selectStatusCode} = require('../lib/helper');
22
22
  function stringController(callback, statusCode) {
23
23
  return async (req, res, next) => {
24
24
  try {
25
- const result = await callback(req);
25
+ const result = await callback(req, res);
26
26
 
27
27
  const string = (result === undefined) ? '' : result;
28
28