Skip to content

Commit 40cdc09

Browse files
committed
Make whitespace normalization less susceptible to ReDoS
1 parent 419f1a4 commit 40cdc09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function build(statics) {
5252

5353
function commit() {
5454
if (!inTag) {
55-
if (field || (buffer = buffer.replace(/^\s*\n+\s*|\s*\n+\s*$/g,''))) {
55+
if (field || (buffer = buffer.replace(/^\s*\n\s*|\s*\n\s*$/g,''))) {
5656
if (hasChildren++) out += ',';
5757
out += field || JSON.stringify(buffer);
5858
}

0 commit comments

Comments
 (0)