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 <[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]>
  • Loading branch information
gurgunday authored and ruyadorno committed Dec 20, 2024
1 parent 2f594ca commit 72db184
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 @@ -705,7 +705,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 72db184

Please sign in to comment.