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
|
@ -181,7 +181,7 @@ describe('webRequest module', () => {
|
|||
callback({ cancel: true });
|
||||
});
|
||||
const fileURL = url.format({
|
||||
pathname: path.join(fixturesPath, 'blank.html').replace(/\\/g, '/'),
|
||||
pathname: path.join(fixturesPath, 'blank.html').replaceAll('\\', '/'),
|
||||
protocol: 'file',
|
||||
slashes: true
|
||||
});
|
||||
|
@ -395,7 +395,7 @@ describe('webRequest module', () => {
|
|||
onSendHeadersCalled = true;
|
||||
});
|
||||
await ajax(url.format({
|
||||
pathname: path.join(fixturesPath, 'blank.html').replace(/\\/g, '/'),
|
||||
pathname: path.join(fixturesPath, 'blank.html').replaceAll('\\', '/'),
|
||||
protocol: 'file',
|
||||
slashes: true
|
||||
}));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue