@middy/http-partial-response 4.3.1 → 4.4.0
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/index.cjs +6 -4
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -4,11 +4,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
Object.defineProperty(module, "exports", {
|
|
6
6
|
enumerable: true,
|
|
7
|
-
get: ()
|
|
7
|
+
get: function() {
|
|
8
|
+
return _default;
|
|
9
|
+
}
|
|
8
10
|
});
|
|
9
|
-
const
|
|
11
|
+
const _jsonmask = _interop_require_default(require("json-mask"));
|
|
10
12
|
const _util = require("@middy/util");
|
|
11
|
-
function
|
|
13
|
+
function _interop_require_default(obj) {
|
|
12
14
|
return obj && obj.__esModule ? obj : {
|
|
13
15
|
default: obj
|
|
14
16
|
};
|
|
@@ -30,7 +32,7 @@ const httpPartialResponseMiddleware = (opts = {})=>{
|
|
|
30
32
|
const bodyIsString = typeof body === 'string';
|
|
31
33
|
const parsedBody = (0, _util.jsonSafeParse)(body);
|
|
32
34
|
if (typeof parsedBody !== 'object') return;
|
|
33
|
-
const filteredBody = (0,
|
|
35
|
+
const filteredBody = (0, _jsonmask.default)(parsedBody, fields);
|
|
34
36
|
request.response.body = bodyIsString ? JSON.stringify(filteredBody) : filteredBody;
|
|
35
37
|
};
|
|
36
38
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-partial-response",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Http partial response middleware for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"url": "https://github.com/sponsors/willfarrell"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@middy/util": "4.
|
|
70
|
+
"@middy/util": "4.4.0",
|
|
71
71
|
"json-mask": "2.0.0"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "5b574488798c48bc74269af7deb3ff95139bcdcc",
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@middy/core": "4.
|
|
75
|
+
"@middy/core": "4.4.0"
|
|
76
76
|
}
|
|
77
77
|
}
|