title: Typescript Enum with string values can only be compared as string
body: <p>I have the following enum:</p>
  
  <pre><code>export enum SortDirection {
    Asc = "asc",
    Desc = "desc"
  }
  </code></pre>
  
  <p>I've added the string values for my enum items so I can pass them into the lodash <code>orderBy</code> function.  This works well.</p>
  
  <p>The problem, however, now occurs when I try to compare the enum as an enum.  Eg.</p>
  
  <pre><code>export function getSortColumnClass(column: any, currentColumn: any,
      currentDirection: SortDirection): string {
      let className = "sorted-header";
      if (currentDirection === SortDirection.Asc) {
          className += " sorted-header-asc";
      } 
      else {
          className += " sorted-header-desc";
      }
      return className;
  }
  </code></pre>
  
  <p>Even though <code>currentDirection</code> is of type <code>SortDirection</code> in the function parameter list, <code>currentDirection === SortDirection.Asc</code> throws an error because <code>currentDirection</code> is coming through as a string.  When I check <code>typeof currentDirection</code>, it even returns <code>string</code>.  I would have to change the conditional to <code>currentDirection === 'asc'</code> which, of course, no longer makes it type-safe.</p>
  
  <p>I'm expecting to be able to use the type-safe Enum item unless I were to call <code>toString()</code> on it to get the string "version" of the Enum value.</p>