class-validator-extended
Version:
Additional validators for class-validator.
19 lines (18 loc) • 542 B
TypeScript
import type { ValidationOptions } from 'class-validator';
/** @hidden */
export declare const ARRAY_SIZE = "arraySize";
/**
* Checks if the given value is an array with a size of exactly `size`.
*
* #### Example
* ```typescript
* // Ensure the array has exactly 5 entries.
* @ArraySize(5)
* values: string[]
* ```
*
* @category Array
* @param size The allowed size of the array.
* @param options Generic class-validator options.
*/
export declare function ArraySize(size: number, options?: ValidationOptions): PropertyDecorator;