UNPKG

class-validator-extended

Version:
21 lines (20 loc) 811 B
import type { ValidationOptions } from 'class-validator'; /** @hidden */ export declare const MAP_NOT_CONTAINS = "mapNotContains"; /** * 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 values. * * #### Example * ```typescript * // Ensure the map does not contain the values 'foo' and 'bar'. * @MapNotContains(['foo', 'bar']) * values: Map<number, string> * ``` * * @category Map * @param forbidden The values forbidden in the given map. * @param options Generic class-validator options. * @typeParam Value The type of values to check for. */ export declare function MapNotContains<Value = unknown>(forbidden: Iterable<Value>, options?: ValidationOptions): PropertyDecorator;