title: Replace conditions with enum in Typescript
body: <p>Having the following original code, it is a function which based on the value of <code>toCheck</code> is building a css class:</p>
  <pre><code>const computeSomething = (toCheck: string) =&gt; {
     return clsx('flex', {
       'flex-start': toCheck === 'FIRST',
       'flex-end': toCheck === 'LAST'
     });
  }
  </code></pre>
  <p>The requirement is to use <code>enum</code> for <code>toCheck</code>, tried something but probably it's wrong:</p>
  <pre><code>export enum toCheck {
    FIRST = 'FIRST',
    LAST = 'LAST'
  }
  
  const computeSomething = (toCheck: string) =&gt; {
     return clsx('flex', {
       'flex-start': toCheck.FIRST,
       'flex-end': toCheck.LAST
     });
  }
  </code></pre>
  <p>The error says:</p>
  <blockquote>
  <p>Property 'FIRST' does not exist on type 'string'.</p>
  </blockquote>
  <p>Any ideas?</p>