Skip to content

Commit eb28e66

Browse files
committed
Shortened regex line
1 parent dfe8a05 commit eb28e66

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/views/providers/helpers.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,5 @@
55
'use strict';
66

77
export function stripComments(line: string): string {
8-
// eslint-disable-next-line
9-
const re1 = /\s*\([^\)]*\)/g; // Remove anything inside the parentheses
10-
const re2 = /\s*;.*/g; // Remove anything after a semi-colon to the end of the line, including preceding spaces
11-
const re3 = /\s+/g;
12-
13-
return line.replace(re1, '').replace(re2, '').replace(re3, '');
8+
return line.replace(/\s*\(.*\)\s*$|^\s*;.*/g, '');
149
}

0 commit comments

Comments
 (0)