title: Type 'string' is not assignable to type 'ArrayBuffer | ArrayLike<number> | SharedArrayBuffer'
body: <p>I get an error [ts] in <code>const arr = new Uint8Array(fileReader.result).subarray(0, 4);</code> and particularly in <code>fileReader.result</code> in line 11. <br> </p>
  
  <blockquote>
    <p>Argument of type 'string | ArrayBuffer' is not assignable to parameter of type 'ArrayBuffer | ArrayLike | SharedArrayBuffer'.<br>
    &nbsp; Type 'string' is not assignable to type 'ArrayBuffer | ArrayLike | SharedArrayBuffer'.</p>
  </blockquote>
  
  <pre><code>import { AbstractControl } from '@angular/forms';
  import { Observable, Observer } from 'rxjs';
  
  export const mimeType = (
      control: AbstractControl
      ): Promise&lt;{ [key: string]: any }&gt; | Observable&lt;{ [key: string]: any }&gt;  =&gt; {
                const file = control.value as File;
                const fileReader = new FileReader();
                const frObs = Observable.create(
                  (observer: Observer&lt;{ [key: string]: any }&gt;) =&gt; {
                    fileReader.addEventListener('loadend', () =&gt; {
                      const arr = new Uint8Array(fileReader.result).subarray(0, 4);
                      let header = '';
                      let isValid = false;
                      for (let i = 0; i &lt; arr.length; i++) {
                        header += arr[i].toString(16);
                      }
  </code></pre>
  
  <p>Can you guys please share a solution. Thanks</p>