title: Forcing excess-property checking on variable passed to TypeScript function
body: <p>Is there a way to <em>force</em> excess-property checking to happen, not just for an inlined object literal but one that derives from a variable?</p>
  
  <p>For example, suppose I have an interface and a function</p>
  
  <pre><code>interface Animal {
      speciesName: string
      legCount: number,
  }
  
  function serializeBasicAnimalData(a: Animal) {
      // something
  }
  </code></pre>
  
  <p><br/></p>
  
  <p>If I call </p>
  
  <pre><code>serializeBasicAnimalData({
      legCount: 65,
      speciesName: "weird 65-legged animal",
      specialPowers: "Devours plastic"
  })
  </code></pre>
  
  <p>I would get an error -- which for my situation, is what I want.  I only want the function to take in a generic animal description without extra specifics.</p>
  
  <p><br/>
  On the other hand, if I first create a variable for it, I don't get the error:</p>
  
  <pre><code>var weirdAnimal = {
      legCount: 65,
      speciesName: "weird 65-legged animal",
      specialPowers: "Devours plastic"
  };
  serializeBasicAnimalData(weirdAnimal);
  </code></pre>
  
  <p><br/></p>
  
  <p>So my question is:  Is there a way to somehow force TypeScript to apply "excess property checking" to the function parameter irrespective of whether it's an inlined object or an object that has previously been assigned to a variable?</p>
  
  <p> </p>