class-validator-extended
Version:
Additional validators for class-validator.
21 lines (20 loc) • 761 B
TypeScript
import type { ValidationOptions } from 'class-validator';
/** @hidden */
export declare const SET_CONTAINS = "setContains";
/**
* Checks if the given value is a [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set)
* and contains all required values.
*
* #### Example
* ```typescript
* // Ensure the set contains (at least) 'foo' and 'bar'.
* @SetContains(['foo', 'bar'])
* values: Set<string>
* ```
*
* @category Set
* @param required The values required in the given set.
* @param options Generic class-validator options.
* @typeParam Value The type of values to check for.
*/
export declare function SetContains<Value = unknown>(required: Iterable<Value>, options?: ValidationOptions): PropertyDecorator;