Skip to content

Commit eef06f7

Browse files
authored
lib: remove redundant global regexps
PR-URL: #56182 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent bd3c25c commit eef06f7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/internal/util/debuglog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function formatTime(ms) {
173173
}
174174

175175
function safeTraceLabel(label) {
176-
return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
176+
return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
177177
}
178178

179179
/**

lib/url.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,7 @@ Url.prototype.format = function format() {
704704
}
705705
}
706706

707-
search = search.replace(/#/g, '%23');
707+
search = search.replaceAll('#', '%23');
708708

709709
if (hash && hash.charCodeAt(0) !== CHAR_HASH)
710710
hash = '#' + hash;

0 commit comments

Comments
 (0)