Skip to content

Commit

Permalink
move printable ASCII symbol check after case fold
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Sep 19, 2023
1 parent e7739a1 commit c79b077
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rewrite-pattern.js
Original file line number Diff line number Diff line change
Expand Up @@ -677,12 +677,12 @@ const processTerm = (item, regenerateOptions, groups) => {
break;
case 'value':
const codePoint = item.codePoint;
if (item.kind === "symbol" && codePoint >= 0x20 && codePoint <= 0x7E) {
const set = regenerate(codePoint);
const folded = maybeFold(codePoint);
if (folded.length === 1 && item.kind === "symbol" && folded[0] >= 0x20 && folded[0] <= 0x7E) {
// skip regenerate when it is a printable ASCII symbol
break;
}
const set = regenerate(codePoint);
const folded = maybeFold(codePoint);
set.add(folded);
update(item, set.toString(regenerateOptions));
break;
Expand Down

0 comments on commit c79b077

Please sign in to comment.