Skip to content

Commit

Permalink
fix the regular expression for function clean in utils.js (#4770)
Browse files Browse the repository at this point in the history
  • Loading branch information
yetingli authored Aug 25, 2022
1 parent 77c18d2 commit 61b4b92
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ exports.clean = function (str) {
.replace(/^\uFEFF/, '')
// (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
.replace(
/^function(?:\s*|\s+[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\s*\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\s*\}|((?:.|\n)*))$/,
/^function(?:\s*|\s[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/,
'$1$2$3'
);

Expand Down

0 comments on commit 61b4b92

Please sign in to comment.