Skip to content

Commit 01d033e

Browse files
authoredOct 9, 2022
fix: avoid mutating provided options (#227)
1 parent 7b45b9b commit 01d033e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed
 

‎package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/MagicString.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -350,8 +350,7 @@ export default class MagicString {
350350

351351
overwrite(start, end, content, options) {
352352
options = options || {};
353-
options.overwrite = !options.contentOnly;
354-
return this.update(start, end, content, options);
353+
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
355354
}
356355

357356
update(start, end, content, options) {

0 commit comments

Comments
 (0)
Please sign in to comment.