Skip to content

Commit

Permalink
Clear text node on null/undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
WebReflection committed Nov 13, 2023
1 parent 6d1d528 commit 89ba9e7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion esm/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,9 @@ export function hole(node, value) {
}
case 'object':
case 'undefined': {
n.replaceWith((this.n = value == null ? node : value.valueOf()));
if (value == null) (this.n = node).data = '';
else this.n = value.valueOf();
n.replaceWith(this.n);
break;
}
}
Expand Down
4 changes: 2 additions & 2 deletions index.js

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

Loading

0 comments on commit 89ba9e7

Please sign in to comment.