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