title: Can I compare number variables with 'class-validator'?
body: <h1>Hi! I have a question about class-validator</h1>
  
  <p>My client will request multiple numbers and I need to compare values each other.</p>
  
  <p>I want code like below.</p>
  
  <pre class="lang-js prettyprint-override"><code>const validator: SomeValidator = new SomeValidator;
  validator.first = 1000;
  validator.second = 2000; // this will be greater than validator.first
  validator.third = 3000; // this will be greater than validator.second
  </code></pre>
  
  <p>And I tried input variable into @Min() validator like below</p>
  
  <pre class="lang-js prettyprint-override"><code>import { IsInt, Min } from 'class-validator';
  
  class SomeValidator {
  
    @IsInt()
    @Min(0)
    public first: number;
  
    @IsInt()
    @Min(this.first) // it occurs TS7017
    public second: number;
  
    @IsInt()
    @Min(this.second) // it occurs TS7017
    public third: number;
  
  }
  </code></pre>
  
  <p>And I got <strong>TS7017 Error</strong>.</p>
  
  <pre><code>TS7017: Element implicitly has an 'any' type because type 'typeof globalThis' has no index signature.
  </code></pre>
  
  <p>Is there any perfect way to handle this?</p>
  
  <p>I know there is simple way like below, but <strong>I wish there is some way to using class-validator.</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>if ((first &gt; second) || (second &gt; third)) {
    res.status(400).json({
      message: 'validation failed',
    });
    return next(new Error('some error'));
  </code></pre>