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

bug: constructor mutates it's argument (options) #101

Open
adrian-gierakowski opened this issue Nov 19, 2021 · 0 comments
Open

bug: constructor mutates it's argument (options) #101

adrian-gierakowski opened this issue Nov 19, 2021 · 0 comments

Comments

@adrian-gierakowski
Copy link

for example here:

options = options || {};
options.keepAlive = options.keepAlive !== false;
// default is keep-alive and 15s free socket timeout
if (options.freeSocketTimeout === undefined) {
options.freeSocketTimeout = 15000;
}

If the options argument is defined it should be cloned before having it's props mutated.

I'm happy to submit a PR, just wanted to check that the author agrees with the suggestion

@adrian-gierakowski adrian-gierakowski changed the title constructor mutates it's argument (options) bug: constructor mutates it's argument (options) Nov 19, 2021
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

No branches or pull requests

1 participant