@nattyjs/core 0.0.1-beta.35 → 0.0.1-beta.37
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 +1 -3
- package/dist/index.mjs +1 -3
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -418,7 +418,7 @@ class BaseResponse {
|
|
|
418
418
|
}
|
|
419
419
|
|
|
420
420
|
function getTypedErrorMessage(type, value) {
|
|
421
|
-
const message = common.commonContainer.nattyConfig.modelBinding
|
|
421
|
+
const message = common.commonContainer.nattyConfig?.modelBinding?.errorMessage?.typed ? common.commonContainer.nattyConfig?.modelBinding?.errorMessage?.typed[type] : "";
|
|
422
422
|
return parseMessage(message, [value]);
|
|
423
423
|
}
|
|
424
424
|
function parseMessage(message, value) {
|
|
@@ -863,8 +863,6 @@ class ModelBindingContext extends ParameterTypeConverter {
|
|
|
863
863
|
else
|
|
864
864
|
this.data = body;
|
|
865
865
|
this.instance = this.convertToInstance(this.type, this.data);
|
|
866
|
-
if (!this.isValid)
|
|
867
|
-
throw new HttpBadRequestException(CreateProblemDetail(this.type, this.errors));
|
|
868
866
|
}
|
|
869
867
|
get isValid() {
|
|
870
868
|
const errors = runValidators(this.type, this.instance);
|
package/dist/index.mjs
CHANGED
|
@@ -416,7 +416,7 @@ class BaseResponse {
|
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
function getTypedErrorMessage(type, value) {
|
|
419
|
-
const message = commonContainer.nattyConfig.modelBinding
|
|
419
|
+
const message = commonContainer.nattyConfig?.modelBinding?.errorMessage?.typed ? commonContainer.nattyConfig?.modelBinding?.errorMessage?.typed[type] : "";
|
|
420
420
|
return parseMessage(message, [value]);
|
|
421
421
|
}
|
|
422
422
|
function parseMessage(message, value) {
|
|
@@ -861,8 +861,6 @@ class ModelBindingContext extends ParameterTypeConverter {
|
|
|
861
861
|
else
|
|
862
862
|
this.data = body;
|
|
863
863
|
this.instance = this.convertToInstance(this.type, this.data);
|
|
864
|
-
if (!this.isValid)
|
|
865
|
-
throw new HttpBadRequestException(CreateProblemDetail(this.type, this.errors));
|
|
866
864
|
}
|
|
867
865
|
get isValid() {
|
|
868
866
|
const errors = runValidators(this.type, this.instance);
|
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.37",
|
|
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.37"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"unbuild": "1.2.1"
|