Skip to content

Commit

Permalink
Clones options object to avoid mutating the original
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed Oct 19, 2017
1 parent 57f49ee commit 0a4824a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function parse(command, args, options) {
}

args = args ? args.slice(0) : []; // Clone array to avoid changing the original
options = options || {};
options = options ? assign({}, options) : {}; // Clone object to avoid changing the original

// Build our parsed object
parsed = {
Expand Down

0 comments on commit 0a4824a

Please sign in to comment.