refactor: use replaceAll()
instead of replace()
when appropriate (#39721)
refactor: use replaceAll() instead of replace() when appropriate
This commit is contained in:
parent
029127a8b6
commit
f6e8544ef6
10 changed files with 20 additions and 20 deletions
|
@ -1128,7 +1128,7 @@ describe('protocol module', () => {
|
|||
protocol.handle('file', (req) => {
|
||||
let file;
|
||||
if (process.platform === 'win32') {
|
||||
file = `file:///${filePath.replace(/\\/g, '/')}`;
|
||||
file = `file:///${filePath.replaceAll('\\', '/')}`;
|
||||
} else {
|
||||
file = `file://${filePath}`;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue