Skip to content

Commit 33f5dee

Browse files
fix: clone options object before mutating it
1 parent 2da2ddb commit 33f5dee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ export function target(target) {
4949
}
5050

5151
export function transform(source, options = {}) {
52+
// We clone the options object because we mutate it later on. If we don't, then
53+
// issues crop up if the caller re-uses the same options object between calls
54+
// to this function.
55+
options = Object.assign({}, options);
5256
let ast;
5357
let jsx = null;
5458

0 commit comments

Comments
 (0)