Skip to content

Commit 199ff1c

Browse files
Strip comments early
1 parent 7330fcd commit 199ff1c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/parse.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export function parse(text) {
1313
headers: {},
1414
};
1515

16-
const lines = text.split('\n');
16+
const lines = text
17+
.replace(/\/\/[^\n\r]+?(?:\*\)|[\n\r])/g, '')
18+
.split('\n');
1719

1820
let parsedRequest = false;
1921
let parsedHeaders = false;

0 commit comments

Comments
 (0)