@nattyjs/core 0.0.1-beta.27 → 0.0.1-beta.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/dist/index.cjs +3 -1
- package/dist/index.mjs +3 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -371,6 +371,7 @@ class BaseResult {
|
|
|
371
371
|
}
|
|
372
372
|
|
|
373
373
|
function getResponseBodyObject(body, props) {
|
|
374
|
+
const sensitiveProps = common.commonContainer.nattyConfig?.secure?.sensitiveProps;
|
|
374
375
|
if (body instanceof common.List)
|
|
375
376
|
return getResponseBodyObject(body.values, body.props);
|
|
376
377
|
if (Array.isArray(body)) {
|
|
@@ -384,7 +385,8 @@ function getResponseBodyObject(body, props) {
|
|
|
384
385
|
const keys = Object.keys(body);
|
|
385
386
|
const getterProps = props ? Object.keys(props).map((key) => props[key]) : [];
|
|
386
387
|
for (const key of [...keys, ...getterProps])
|
|
387
|
-
|
|
388
|
+
if (!sensitiveProps || sensitiveProps.filter((t) => t == key.toLowerCase()).length == 0)
|
|
389
|
+
jObject[key] = getResponseBodyObject(body[key]);
|
|
388
390
|
return jObject;
|
|
389
391
|
}
|
|
390
392
|
return body;
|
package/dist/index.mjs
CHANGED
|
@@ -369,6 +369,7 @@ class BaseResult {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
function getResponseBodyObject(body, props) {
|
|
372
|
+
const sensitiveProps = commonContainer.nattyConfig?.secure?.sensitiveProps;
|
|
372
373
|
if (body instanceof List)
|
|
373
374
|
return getResponseBodyObject(body.values, body.props);
|
|
374
375
|
if (Array.isArray(body)) {
|
|
@@ -382,7 +383,8 @@ function getResponseBodyObject(body, props) {
|
|
|
382
383
|
const keys = Object.keys(body);
|
|
383
384
|
const getterProps = props ? Object.keys(props).map((key) => props[key]) : [];
|
|
384
385
|
for (const key of [...keys, ...getterProps])
|
|
385
|
-
|
|
386
|
+
if (!sensitiveProps || sensitiveProps.filter((t) => t == key.toLowerCase()).length == 0)
|
|
387
|
+
jObject[key] = getResponseBodyObject(body[key]);
|
|
386
388
|
return jObject;
|
|
387
389
|
}
|
|
388
390
|
return body;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattyjs/core",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.28",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "ajayojha",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"tsyringe": "^4.7.0",
|
|
19
19
|
"path-to-regexp": "6.2.1",
|
|
20
|
-
"@nattyjs/common": "0.0.1-beta.
|
|
20
|
+
"@nattyjs/common": "0.0.1-beta.28"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"unbuild": "1.2.1"
|