class-validator-extended
Version:
Additional validators for class-validator.
20 lines (19 loc) • 627 B
TypeScript
import type { ValidationOptions } from 'class-validator';
/** @hidden */
export declare const MAP_SIZE = "mapSize";
/**
* Checks if the given value is a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
* with a size of exactly `size`.
*
* #### Example
* ```typescript
* // Ensure the map has exactly 5 entries.
* @MapSize(5)
* values: Map<string, string>
* ```
*
* @category Map
* @param size The allowed size of the map.
* @param options Generic class-validator options.
*/
export declare function MapSize(size: number, options?: ValidationOptions): PropertyDecorator;