Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
lib: remove redundant global regexps
  • Loading branch information
gurgunday committed Dec 8, 2024
commit f9a7c96edebb1ff1f244b93b21c2d1922fe2dd0f
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