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

Make sure got.mergeOptions(...) can be assigned to defaults #1008

Merged
merged 2 commits into from
Jan 1, 2020

Conversation

szmarczak
Copy link
Collaborator

Fixes #993

@@ -56,7 +56,7 @@ interface GotFunctions {

export interface Got extends Record<HTTPAlias, GotFunctions>, GotFunctions {
stream: GotStream;
defaults: Defaults | Readonly<Defaults>;
defaults: Defaults;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No point in having Defaults | Readonly<Defaults> as in some cases TS misguesses it as Readonly<Defaults> and people have to cast it to Defaults anyway. The JS runtime will throw anyway if anyone tries to modify frozen defaults.

@sindresorhus sindresorhus merged commit 1360a1b into sindresorhus:master Jan 1, 2020
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.

Cannot assign got.mergeOptions(...) to instance defaults
2 participants