@nattyjs/core 0.0.1-beta.26 → 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 +4 -2
- package/dist/index.mjs +4 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -223,9 +223,9 @@ function doubleDash(value) {
|
|
|
223
223
|
return value ? value.replace(/--/g, "") : value;
|
|
224
224
|
}
|
|
225
225
|
function sanitizeSpecialCodes(value) {
|
|
226
|
+
value = ampersand(value);
|
|
226
227
|
value = lessThan(value);
|
|
227
228
|
value = greaterThan(value);
|
|
228
|
-
value = ampersand(value);
|
|
229
229
|
value = doubleDash(value);
|
|
230
230
|
return value;
|
|
231
231
|
}
|
|
@@ -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
|
@@ -221,9 +221,9 @@ function doubleDash(value) {
|
|
|
221
221
|
return value ? value.replace(/--/g, "") : value;
|
|
222
222
|
}
|
|
223
223
|
function sanitizeSpecialCodes(value) {
|
|
224
|
+
value = ampersand(value);
|
|
224
225
|
value = lessThan(value);
|
|
225
226
|
value = greaterThan(value);
|
|
226
|
-
value = ampersand(value);
|
|
227
227
|
value = doubleDash(value);
|
|
228
228
|
return value;
|
|
229
229
|
}
|
|
@@ -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"
|