Skip to content
Permalink
Browse files
fix the regular expression for function clean in utils.js (#4770)
  • Loading branch information
yetingli committed Aug 25, 2022
1 parent 77c18d2 commit 61b4b9209c2c64b32c8d48b1761c3b9384d411ea
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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'
);

0 comments on commit 61b4b92

Please sign in to comment.