Skip to content

Commit

Permalink
Don't mutate the user-supplied object
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Dec 21, 2018
1 parent 1d9e4ee commit f787bfc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ const isAvailable = options => new Promise((resolve, reject) => {
});
});

const getPort = (options = {}) => {
const getPort = options => {
options = Object.assign({}, options);

if (typeof options.port === 'number') {
options.port = [options.port];
}
Expand Down

0 comments on commit f787bfc

Please # to comment.