@inv2/common
Version:
A common module for v2
18 lines (17 loc) • 497 B
TypeScript
import Joi, { Schema } from 'joi';
type IJoiDecorator = (target: any, key: string, descriptor: PropertyDescriptor) => void;
export declare const Validate: (schema: {
[key: string]: Schema;
}, data: {
[key: string]: any;
}) => Joi.ValidationError;
/**
*
* making use of typescript decorators here. the aim here is to
* validate requests to ensure they conform to the schema
*
*/
export declare function JoiMWDecorator(schema: {
[key: string]: Schema;
}): IJoiDecorator;
export {};