Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Object): fix _pick and _omit return type #20

Closed
wants to merge 4 commits into from

Conversation

mrnagydavid
Copy link
Contributor

@mrnagydavid mrnagydavid commented Feb 29, 2024

In this PR, I have modified the return type of _pick and _omit to use Pick<K, T> and Omit<K, T> respectively.

@@ -127,7 +127,7 @@ export interface FetcherRequest
timeoutSeconds: number
retry: FetcherRetryOptions
retryPost: boolean
retry3xx: boolean
retry3xx?: boolean
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without better understanding of the repo, this feels hacky.

TS was complaining that retry3xx is optional in FetcherOptions and mandatory in FetcherRequest
This ? solves the complaint, but probably all the other fields should match. We should probably fix the rest, but I am afraid of a rabbit's hole.

interface FetcherRequest
  extends Omit<FetcherOptions, 'method' | 'headers' | 'baseUrl' | 'url'>  {
  retry3xx: boolean
  // ...

export interface FetcherOptions {
  retry3xx?: boolean
  // ...
}
}

@mrnagydavid
Copy link
Contributor Author

Closing in favor of peace of mind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant