Skip to content

Commit bab1783

Browse files
committed
Clones options object to avoid mutating the original
1 parent 8481c4f commit bab1783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/parse.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function parse(command, args, options) {
113113
}
114114

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

118118
// Build our parsed object
119119
parsed = {

0 commit comments

Comments
 (0)