We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d286494 commit 6076e90Copy full SHA for 6076e90
packages/plugin-bundle-stats/src/lib/runner/audits/details/path-utils.ts
@@ -14,12 +14,13 @@ export function splitPathSegments(path: string): string[] {
14
*/
15
export function normalizePathForMatching(path: string): string {
16
// Remove all instances of ../, applying repeatedly to catch overlapping or regenerated cases
17
+ let normalizedPath = path;
18
let prev;
19
do {
- prev = path;
20
- path = path.replace(/\.\.\//g, '');
21
- } while (path !== prev);
22
- return path.replace(/^\/+/, '');
+ prev = normalizedPath;
+ normalizedPath = normalizedPath.replace(/\.\.\//g, '');
+ } while (normalizedPath !== prev);
23
+ return normalizedPath.replace(/^\/+/, '');
24
}
25
26
/**
0 commit comments