Skip to content

Commit f10239f

Browse files
gurgundayaduh95
authored andcommitted
lib: remove redundant global regexps
PR-URL: #56182 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent fa667d6 commit f10239f

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
@@ -705,7 +705,7 @@ Url.prototype.format = function format() {
705705
}
706706
}
707707

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

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy