Skip to content

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

Open
@adrian-gierakowski

Description

@adrian-gierakowski

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions