Skip to content

Commit

Permalink
fix: avoid mutating provided options (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann committed Oct 9, 2022
1 parent 7b45b9b commit 01d033e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/MagicString.js
Expand Up @@ -350,8 +350,7 @@ export default class MagicString {

overwrite(start, end, content, options) {
options = options || {};
options.overwrite = !options.contentOnly;
return this.update(start, end, content, options);
return this.update(start, end, content, { ...options, overwrite: !options.contentOnly });
}

update(start, end, content, options) {
Expand Down

0 comments on commit 01d033e

Please sign in to comment.