@men-mvc/foundation
Advanced tools
Comparing version 0.87.0 to 0.88.0
@@ -0,3 +1,5 @@ | ||
import { ExternalHelpers } from 'joi'; | ||
import joi, { ObjectSchema, ValidationError as JoiValidationError, ValidationOptions } from 'joi'; | ||
import { ValidationError, RequestValidator } from '../types'; | ||
export declare const getValidatedFieldName: (options: ExternalHelpers) => string; | ||
export declare const resolveValidationError: (valError: JoiValidationError | undefined) => ValidationError; | ||
@@ -4,0 +6,0 @@ export declare const validateRequest: <T>(schema: ObjectSchema, data: T, options?: ValidationOptions) => void; |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ValidateRequestAsync = exports.ValidateRequest = exports.validateFileExtension = exports.validateImage = exports.validateFile = exports.failValidationForField = exports.validateRequestAsync = exports.validateRequest = exports.resolveValidationError = void 0; | ||
exports.ValidateRequestAsync = exports.ValidateRequest = exports.validateFileExtension = exports.validateImage = exports.validateFile = exports.failValidationForField = exports.validateRequestAsync = exports.validateRequest = exports.resolveValidationError = exports.getValidatedFieldName = void 0; | ||
const path_1 = __importDefault(require("path")); | ||
@@ -14,2 +14,14 @@ const joi_1 = __importDefault(require("joi")); | ||
const error_1 = require("./error"); | ||
const getValidatedFieldName = (options) => { | ||
if (Array.isArray(options.state.path)) { | ||
return options.state.path.join('.'); | ||
} | ||
else if (typeof options.state.path === 'string') { | ||
return options.state.path; | ||
} | ||
else { | ||
return ``; | ||
} | ||
}; | ||
exports.getValidatedFieldName = getValidatedFieldName; | ||
const resolveValidationError = (valError) => { | ||
@@ -16,0 +28,0 @@ if (!valError) { |
{ | ||
"name": "@men-mvc/foundation", | ||
"version": "0.87.0", | ||
"version": "0.88.0", | ||
"description": "Package that includes shared variables, types and utility functions for MEN MVC framework.", | ||
@@ -30,3 +30,3 @@ "private": false, | ||
"dependencies": { | ||
"@men-mvc/config": "^0.87.0", | ||
"@men-mvc/config": "^0.88.0", | ||
"express": "^4.18.2", | ||
@@ -53,3 +53,3 @@ "joi": "^17.9.1", | ||
"license": "MIT", | ||
"gitHead": "01674a5ff2259af688a26fb5bce16ad5e7c5ae09" | ||
"gitHead": "c56244162e6340358d2407db2957316bbd00a618" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
73086
1504
+ Added@men-mvc/config@0.88.0(transitive)
- Removed@men-mvc/config@0.87.0(transitive)
Updated@men-mvc/config@^0.88.0