title: How to avoid repetition with validators in nestjs?
body: <p>I was wondering if there was any way to apply a single validator to many fields in a dto, as I find myself repeating it constantly, as an example:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>export class CreateDto {
    @IsNotEmpty()
    @IsString()
    readonly name: string;
    @IsNotEmpty()
    @IsNumber()
    readonly A_VAL: number;
    @IsNotEmpty()
    @IsNumber()
    readonly B_VAL: number;
    @IsNotEmpty()
    @IsNumber()
    readonly ABS_TEMP: number;
    @IsOptional()
    @IsMongoId({each: true})
    readonly project: string[];
    @IsOptional()
    @IsMongoId({each: true})
    readonly company: string[];
  }</code></pre>
  </div>
  </div>
  
  I'm pretty new with these so any help would be appreciated. Thanks.</p>