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