title: Typescript ignores explicitly stated ANY type and treats variable as type object if _.isObject() is used on the variable, causing property name errors
body: <p>When I have a variable typed &quot;any&quot; and do a lodash check for _.isObject, and then try to access properties on the variable, it raises the typescript error <code>error TS2339: Property 'propertyName' does not exist on type 'object'.</code></p>
  <p>My expectation is that typescript continues to treat the variable as <code>:any</code> because that's what is explicitly declared, and that it allows accessing any properties on the object without raising typescript errors.</p>
  <hr />
  <h1>Example</h1>
  <h2>No object check, no typescript error:</h2>
  <pre><code>const myObjectVariable: any = service.getObject();
  this.anotherVariable = myObjectVariable.propertyName;
  </code></pre>
  <h2>Object check causes error:</h2>
  <pre><code>const myObjectVariable: any = service.getObject();
  if (_.isObject(myObjectVariable) {
      this.anotherVariable = myObjectVariable.propertyName;
  }
  </code></pre>
  <p>Raises: <code>error TS2339: Property 'propertyName' does not exist on type 'object'.</code></p>
  <p><strong>Why is this happening where typescript ignores the original type and treats it as an object, and can I turn it off or make it stop without changing the code?</strong></p>