title: Typescript: Check "typeof" against custom type
body: <p>I have a custom type, let's say</p>
  
  <pre><code>export type Fruit = "apple" | "banana" | "grape";
  </code></pre>
  
  <p>I would like to determine if a string is part of the Fruit type. How can I accomplish this? </p>
  
  <p>The following doesn't work.</p>
  
  <pre><code>let myfruit = "pear";
  if (typeof myfruit === "Fruit") {
      console.log("My fruit is of type 'Fruit'");
  }
  </code></pre>
  
  <p>Any thoughts appreciated!</p>