node-pluginsmanager-plugin 6.4.0 → 6.4.2

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.
@@ -5,7 +5,13 @@ exports.default = send;
5
5
  // module
6
6
  function send(req, res, code, content, options) {
7
7
  return Promise.resolve().then(() => {
8
- if (!content) {
8
+ if ("undefined" === typeof content) {
9
+ return "";
10
+ }
11
+ else if ("object" === typeof content && content instanceof Buffer) {
12
+ return content;
13
+ }
14
+ else if ("string" === typeof content && "" === content) {
9
15
  return "";
10
16
  }
11
17
  else {
@@ -38,7 +44,7 @@ function send(req, res, code, content, options) {
38
44
  res.statusCode = code;
39
45
  res.headers = Object.assign({
40
46
  "Content-Type": options.mime,
41
- "Content-Length": formattedContent ? Buffer.byteLength(formattedContent) : 0,
47
+ "Content-Length": 0 < formattedContent.length ? Buffer.byteLength(formattedContent) : 0,
42
48
  "Status-Code-Url-Cat": "https://http.cat/" + code,
43
49
  "API-Version": options.apiVersion
44
50
  }, options.cors ? {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
 
3
3
  "name": "node-pluginsmanager-plugin",
4
- "version": "6.4.0",
4
+ "version": "6.4.2",
5
5
  "description": "An abstract parent plugin for node-pluginsmanager",
6
6
 
7
7
  "type": "commonjs",
@@ -43,28 +43,28 @@
43
43
  },
44
44
 
45
45
  "dependencies": {
46
- "@apidevtools/swagger-parser": "10.1.0",
46
+ "@apidevtools/swagger-parser": "10.1.1",
47
47
  "express-openapi-validate": "0.6.1",
48
48
  "uniqid": "5.4.0"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/express": "4.17.21",
52
- "@types/node": "22.10.3",
52
+ "@types/node": "22.10.10",
53
53
  "@types/socket.io": "3.0.2",
54
54
  "@types/uniqid": "5.3.4",
55
- "@types/ws": "8.5.13",
55
+ "@types/ws": "8.5.14",
56
56
  "check-version-modules": "2.1.3",
57
57
  "colors": "1.4.0",
58
58
  "eslint-plugin-personnallinter": "git+ssh://git@github.com/Psychopoulet/eslint-plugin-personnallinter",
59
59
  "express": "4.21.2",
60
60
  "husky": "9.1.7",
61
- "mocha": "11.0.1",
61
+ "mocha": "11.1.0",
62
62
  "nyc": "17.1.0",
63
63
  "openapi-types": "12.1.3",
64
64
  "rimraf": "6.0.1",
65
65
  "socket.io": "4.8.1",
66
66
  "socket.io-client": "4.8.1",
67
- "typescript": "5.7.2",
67
+ "typescript": "5.7.3",
68
68
  "used-deps-analyzer": "0.1.8",
69
69
  "ws": "8.18.0"
70
70
  },