When we create a base url here:
| constbaseUrl=URL.pathToFileURL(process.cwd()+'/'); |
It will be ignored later here, if the given url contains drive letter ( like "c:/foo/bar") :
| else{ |
| mod=URL.fileURLToPath(newURL.URL(url,baseUrl)); |
| } |
And fileURLToPath will throw an error ( "URL not a file scheme" ) as the drive letter is set as protocol and file scheme of baseUrl is ignored.
I think we are safe when we do it like this:
consturlObject=newURL.URL(url,baseUrl);mod=urlObject.pathName;
Not sure if this is bypassing the reason why fileUrlToPath is used at all.
But did work for me on Windows and macOS.
When we create a base url here:
web-worker/node.js
Line 75 in 4a46d3a
It will be ignored later here, if the given url contains drive letter ( like "c:/foo/bar") :
web-worker/node.js
Lines 100 to 102 in 4a46d3a
And fileURLToPath will throw an error ( "URL not a file scheme" ) as the drive letter is set as protocol and file scheme of baseUrl is ignored.
I think we are safe when we do it like this:
Not sure if this is bypassing the reason why fileUrlToPath is used at all.
But did work for me on Windows and macOS.