Skip to content

Commit

Permalink
fix the regular expression for function clean
Browse files Browse the repository at this point in the history
  • Loading branch information
yetingli committed Oct 15, 2021
1 parent b9456e9 commit 2a3005c
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*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/
/^function(?:\s*|\s[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/,
'$1$2$3'
);

Expand Down

0 comments on commit 2a3005c

Please sign in to comment.