global.d.ts 451 B

12345678910111213141516
  1. /*
  2. I was getting this error while running Jest:
  3. packages/app/src/views/ExploreView/ExploreView.tsx:15:48 - error
  4. TS2339: Property 'flat' does not exist on type 'unknown[]'.
  5. I tried adding "ES2019" and "ES2019.Array" to Typescript lib compiler options to no avail.
  6. The only way I was able to fix this issue was to add 'flat' to Typescript globals (this file).
  7. */
  8. interface Array<T> {
  9. flat(): Array<T>
  10. flatMap(func: (x: T) => T): Array<T>
  11. }