data-transfer-object
Version:
Data Transfer Object class built on `class-validator`.
16 lines (15 loc) • 725 B
TypeScript
import type { ValidationError } from 'class-validator';
/**
* An object with key-value pairs where the keys represent a property name, and the values
* are an array of all validation error messages for that property.
*/
export declare type ValidationErrorMap = {
[property: string]: string[];
};
/**
* Receives an array of `ValidationError`, and generates an object with key-value pairs where
* the keys represent a property name, and the values are an array of all validation error
* messages for that property.
* @param errors The array of `ValidationError` to generate a validation error map from.
*/
export declare function getValidationErrorMap(errors: ValidationError[]): ValidationErrorMap;