Skip to content

Commit 61b4b92

Browse files
authoredAug 25, 2022
fix the regular expression for function clean in utils.js (#4770)
1 parent 77c18d2 commit 61b4b92

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎lib/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ exports.clean = function (str) {
7676
.replace(/^\uFEFF/, '')
7777
// (traditional)-> space/name parameters body (lambda)-> parameters body multi-statement/single keep body content
7878
.replace(
79-
/^function(?:\s*|\s+[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\s*\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\s*\}|((?:.|\n)*))$/,
79+
/^function(?:\s*|\s[^(]*)\([^)]*\)\s*\{((?:.|\n)*?)\}$|^\([^)]*\)\s*=>\s*(?:\{((?:.|\n)*?)\}|((?:.|\n)*))$/,
8080
'$1$2$3'
8181
);
8282

0 commit comments

Comments
 (0)
Please sign in to comment.