title: Getting this typescript error: Unsafe member access [key] on an any value
body: <p>I have written a deep equality check function. I am getting this error for highlighted lines.</p>
  <p>Can anyone suggest what I need to do to fix this error (or at least what the error means).</p>
  <p>Code:</p>
  <pre><code>export const deepEqual = (object1: any, object2: any) =&gt; {
    const keys1 = Object.keys(object1);
    const keys2 = Object.keys(object2);
    if (keys1.length !== keys2.length) {
      return false;
    }
    for (const key of keys1) {
      const val1: unknown = object1[key] as unknown; // Error for this line
      const val2: unknown = object2[key] as unknown; // Error for this line
      const areObjects = isObject(val1) &amp;&amp; isObject(val2);
      if (
        (areObjects &amp;&amp; !deepEqual(val1, val2)) ||
        (!areObjects &amp;&amp; val1 !== val2)
      ) {
        return false;
      }
    }
    return true;
  };
  </code></pre>
  <p>Error:</p>
  <pre><code>45:27  error    Unsafe member access [key] on an any value     @typescript-eslint/no-unsafe-member-access
  45:27  error    Unsafe member access [key] on an any value     @typescript-eslint/no-unsafe-member-access
  </code></pre>