Skip to content

Commit

Permalink
lib: remove redundant global regexps
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
gurgunday authored Dec 10, 2024
1 parent bd3c25c commit eef06f7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/internal/util/debuglog.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ function formatTime(ms) {
}

function safeTraceLabel(label) {
return label.replace(/\\/g, '\\\\').replaceAll('"', '\\"');
return label.replaceAll('\\', '\\\\').replaceAll('"', '\\"');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion lib/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ Url.prototype.format = function format() {
}
}

search = search.replace(/#/g, '%23');
search = search.replaceAll('#', '%23');

if (hash && hash.charCodeAt(0) !== CHAR_HASH)
hash = '#' + hash;
Expand Down

0 comments on commit eef06f7

Please sign in to comment.