This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: types for withTimeoutOptions (#3422)
#3407 has introduced regression in type inference for `withTimeoutOptions` function which end up referring to `Fn<Args, R>` type which was declared in other file https://github.com/ipfs/js-ipfs/pull/3407/files#diff-722621abc3ed4edc6ab202fdf684f1607c261394b95da6b3ec79748711056f20 I think TS has this strange WTF where when it can't figure out when JS file is a module it will treat it as if everything is loaded in the same scope. I think that caused `withTimeoutOptions` not to report errors but silently fail and infer return function as `any`. This change fixes that by removes `Fn` type all together, as it seemed like unnecessary complexity. Unfortunately nothing seemed to have caught this regression because we set [`noImplicitAny`](https://www.typescriptlang.org/tsconfig#noImplicitAny) to `false` given that many of our dependencies are untyped.
- Loading branch information