class-validator-extended
Version:
Additional validators for class-validator.
21 lines (20 loc) • 804 B
TypeScript
import type { ValidationOptions } from 'class-validator';
/** @hidden */
export declare const MAP_NOT_CONTAINS_KEYS = "mapNotContainsKeys";
/**
* Checks if the given value is a [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map)
* which does not contain any of the forbidden keys.
*
* #### Example
* ```typescript
* // Ensure the map does not contain the keys 13 and 42.
* @MapNotContainsKeys([13, 42])
* values: Map<number, string>
* ```
*
* @category Map
* @param forbidden The values forbidden in the given map.
* @param options Generic class-validator options.
* @typeParam Key The type of keys to check for.
*/
export declare function MapNotContainsKeys<Key = unknown>(forbidden: Iterable<Key>, options?: ValidationOptions): PropertyDecorator;