@nattyjs/core 0.0.1-beta.52 → 0.0.1-beta.54
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 +7 -6
- package/dist/index.mjs +7 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -274,10 +274,6 @@ var RequestPipeline = /* @__PURE__ */ ((RequestPipeline2) => {
|
|
|
274
274
|
return RequestPipeline2;
|
|
275
275
|
})(RequestPipeline || {});
|
|
276
276
|
|
|
277
|
-
function sanitizeSpecialCodes(value) {
|
|
278
|
-
return value;
|
|
279
|
-
}
|
|
280
|
-
|
|
281
277
|
function isBoolean(value) {
|
|
282
278
|
return typeof value === "boolean" || value === "1" || value === "true" || value === "0" || value === "false";
|
|
283
279
|
}
|
|
@@ -338,7 +334,7 @@ function toInt(value, radix = 0) {
|
|
|
338
334
|
}
|
|
339
335
|
function toString(value) {
|
|
340
336
|
if (isNotBlank(value))
|
|
341
|
-
return
|
|
337
|
+
return String(value);
|
|
342
338
|
return value;
|
|
343
339
|
}
|
|
344
340
|
function whitelist(value, chars) {
|
|
@@ -644,6 +640,8 @@ class ParameterTypeConverter extends BaseResponse {
|
|
|
644
640
|
const sanitizeValue = this.sanitizer[property.type.toLowerCase()] ? this.sanitizer[property.type.toLowerCase()](value) : value;
|
|
645
641
|
if (sanitizeValue === INVALID_VALUE)
|
|
646
642
|
json.invalidProps[property.name] = getTypedErrorMessage(property.type, value);
|
|
643
|
+
else
|
|
644
|
+
json.body[property.name] = sanitizeValue;
|
|
647
645
|
}
|
|
648
646
|
convert(methodInfo, jObject) {
|
|
649
647
|
for (const parameterInfo of methodInfo.parameters) {
|
|
@@ -1337,7 +1335,10 @@ function authenticationOnly() {
|
|
|
1337
1335
|
function setEnvInfo(envTsDefinition, envValueInfo) {
|
|
1338
1336
|
if (envTsDefinition && envValueInfo) {
|
|
1339
1337
|
common.commonContainer.setEnvTsDefinition(envTsDefinition);
|
|
1340
|
-
Object.keys(envValueInfo).forEach((key) =>
|
|
1338
|
+
Object.keys(envValueInfo).forEach((key) => {
|
|
1339
|
+
if (envValueInfo[key])
|
|
1340
|
+
process.env[key] = envValueInfo[key];
|
|
1341
|
+
});
|
|
1341
1342
|
}
|
|
1342
1343
|
}
|
|
1343
1344
|
|
package/dist/index.mjs
CHANGED
|
@@ -272,10 +272,6 @@ var RequestPipeline = /* @__PURE__ */ ((RequestPipeline2) => {
|
|
|
272
272
|
return RequestPipeline2;
|
|
273
273
|
})(RequestPipeline || {});
|
|
274
274
|
|
|
275
|
-
function sanitizeSpecialCodes(value) {
|
|
276
|
-
return value;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
275
|
function isBoolean(value) {
|
|
280
276
|
return typeof value === "boolean" || value === "1" || value === "true" || value === "0" || value === "false";
|
|
281
277
|
}
|
|
@@ -336,7 +332,7 @@ function toInt(value, radix = 0) {
|
|
|
336
332
|
}
|
|
337
333
|
function toString(value) {
|
|
338
334
|
if (isNotBlank(value))
|
|
339
|
-
return
|
|
335
|
+
return String(value);
|
|
340
336
|
return value;
|
|
341
337
|
}
|
|
342
338
|
function whitelist(value, chars) {
|
|
@@ -642,6 +638,8 @@ class ParameterTypeConverter extends BaseResponse {
|
|
|
642
638
|
const sanitizeValue = this.sanitizer[property.type.toLowerCase()] ? this.sanitizer[property.type.toLowerCase()](value) : value;
|
|
643
639
|
if (sanitizeValue === INVALID_VALUE)
|
|
644
640
|
json.invalidProps[property.name] = getTypedErrorMessage(property.type, value);
|
|
641
|
+
else
|
|
642
|
+
json.body[property.name] = sanitizeValue;
|
|
645
643
|
}
|
|
646
644
|
convert(methodInfo, jObject) {
|
|
647
645
|
for (const parameterInfo of methodInfo.parameters) {
|
|
@@ -1335,7 +1333,10 @@ function authenticationOnly() {
|
|
|
1335
1333
|
function setEnvInfo(envTsDefinition, envValueInfo) {
|
|
1336
1334
|
if (envTsDefinition && envValueInfo) {
|
|
1337
1335
|
commonContainer.setEnvTsDefinition(envTsDefinition);
|
|
1338
|
-
Object.keys(envValueInfo).forEach((key) =>
|
|
1336
|
+
Object.keys(envValueInfo).forEach((key) => {
|
|
1337
|
+
if (envValueInfo[key])
|
|
1338
|
+
process.env[key] = envValueInfo[key];
|
|
1339
|
+
});
|
|
1339
1340
|
}
|
|
1340
1341
|
}
|
|
1341
1342
|
|
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.54",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "ajayojha",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"reflect-metadata": "0.2.2",
|
|
19
19
|
"tsyringe": "^4.7.0",
|
|
20
20
|
"path-to-regexp": "6.2.1",
|
|
21
|
-
"@nattyjs/common": "0.0.1-beta.
|
|
21
|
+
"@nattyjs/common": "0.0.1-beta.54"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"unbuild": "1.2.1"
|