title: Typescript: Filter Object by Interface or Class
body: <p>I would like to sync an object that is provided by an API to a table.
  The table is defined in Sequelize and has an interface and a class:</p>
  
  <pre class="lang-js prettyprint-override"><code>declare interface SampleInterface {
    value1?: string;
    value2?: string;
    value3?: number;
  }
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>class SampleClass implements SampleInterface {
    value1?: string;
    value2?: string;
    value3?: number;
  }
  </code></pre>
  
  <p>The response of the API is not always the same, but could look something like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>const sampleResponse = {
    value2: "..."
    value3: 0
    value4: "..."
  }
  </code></pre>
  
  <p>Now, I would only like create a new object that can be passed to sequelize that has the matching contents, for example:</p>
  
  <pre class="lang-js prettyprint-override"><code>const filteredResponse = {
    value2: "..."
    value3: 0
  }
  </code></pre>
  
  <p>How can I match the object properties keys to the interface or class?</p>
  
  <p>Thanks!</p>