pg-mvc-service 2.0.95 → 2.0.97
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.
|
@@ -219,7 +219,7 @@ class RequestType extends ReqResType_1.default {
|
|
|
219
219
|
};
|
|
220
220
|
let errorMessage = list[code];
|
|
221
221
|
const property = this.getProperty(keys);
|
|
222
|
-
switch (property.type) {
|
|
222
|
+
switch (property === null || property === void 0 ? void 0 : property.type) {
|
|
223
223
|
case 'enum':
|
|
224
224
|
case 'enum?':
|
|
225
225
|
errorMessage = errorMessage.replace('{enums}', Object.keys((_a = property.enums) !== null && _a !== void 0 ? _a : '').join(','));
|
|
@@ -775,7 +775,6 @@ class RequestType extends ReqResType_1.default {
|
|
|
775
775
|
if (property.maxLength !== undefined && stringValue.length > property.maxLength) {
|
|
776
776
|
this.throwInputError(isRequestBody ? "STRING_22" : "STRING_92", keys, value);
|
|
777
777
|
}
|
|
778
|
-
console.log(property.regExp, stringValue, property.regExp !== undefined ? property.regExp.test(stringValue) : 'No');
|
|
779
778
|
if (property.regExp !== undefined && property.regExp.test(stringValue) === false) {
|
|
780
779
|
this.throwInputError(isRequestBody ? "STRING_23" : "STRING_93", keys, value);
|
|
781
780
|
}
|
package/package.json
CHANGED
|
@@ -235,7 +235,7 @@ export class RequestType extends ReqResType {
|
|
|
235
235
|
|
|
236
236
|
let errorMessage = list[code];
|
|
237
237
|
const property = this.getProperty(keys);
|
|
238
|
-
switch (property
|
|
238
|
+
switch (property?.type) {
|
|
239
239
|
case 'enum':
|
|
240
240
|
case 'enum?':
|
|
241
241
|
errorMessage = errorMessage.replace('{enums}', Object.keys(property.enums ?? '').join(','));
|
|
@@ -809,7 +809,6 @@ export class RequestType extends ReqResType {
|
|
|
809
809
|
this.throwInputError(isRequestBody ? "STRING_22" : "STRING_92", keys, value);
|
|
810
810
|
}
|
|
811
811
|
|
|
812
|
-
console.log(property.regExp, stringValue, property.regExp !== undefined ? property.regExp.test(stringValue) : 'No');
|
|
813
812
|
if (property.regExp !== undefined && property.regExp.test(stringValue) === false) {
|
|
814
813
|
this.throwInputError(isRequestBody ? "STRING_23" : "STRING_93", keys, value);
|
|
815
814
|
}
|