Skip to content

Commit 5c36fc7

Browse files
josephperrottthePunderWoman
authored andcommitted
fix(compiler-cli): remove unnecessary escaping in regex expressions (#51554)
Correct various Useless regular-expression character escape issues. PR Close #51554
1 parent 04c6574 commit 5c36fc7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/compiler-cli/test/compliance/test_helpers/di_checks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Verifies that there is exactly one factory definition for the provided type.
1111
*/
1212
export function verifyUniqueFactory(output: string, type: string): boolean {
13-
const matches = output.match(new RegExp(type + '\.ɵfac =', 'g'));
13+
const matches = output.match(new RegExp(type + '.ɵfac =', 'g'));
1414
if (matches === null) {
1515
return false;
1616
}

packages/compiler-cli/test/compliance/test_helpers/expected_file_macros.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ function flagUnion(pattern: RegExp, getFlagValue: (...match: string[]) => number
203203
return [
204204
// Match at least one occurrence of the pattern, optionally followed by more occurrences
205205
// separated by a pipe.
206-
new RegExp(pattern.source + '(?:\s*\\\|\s*' + pattern.source + ')*', 'g'),
206+
new RegExp(pattern.source + '(?:s*\\\|s*' + pattern.source + ')*', 'g'),
207207
(match: string) => {
208208
// Replace all matches with the union of the individually matched flags.
209209
return String(match.split('|')

0 commit comments

Comments
 (0)