Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: types for withTimeoutOptions #3422

Merged
merged 1 commit into from
Nov 26, 2020
Merged

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Nov 26, 2020

#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 to false given that many of our dependencies are untyped.

@achingbrain achingbrain merged commit af0b7f3 into master Nov 26, 2020
@achingbrain achingbrain deleted the fix/with-timeout-types branch November 26, 2020 07:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants