• Checks if the given value is a Set without duplicate values with regard to the given projection.

    Example

    // Ensure the set does not include duplicate users.
    @SetUnique<User>(user => user.id)
    administrators: Set<User>

    Type Parameters

    • Value = unknown

      The type of the set's values.

    • Projection = unknown

      The type returned by projection.

    Parameters

    • projection: ((item) => Projection)

      The function mapping each value to the value that is used for the uniqueness check.

    • Optional options: ValidationOptions

      Generic class-validator options.

    Returns PropertyDecorator